Library/Bullhorn/FastRest/Api/Controllers/Base.php
private function createActionProcess() {
        /** @var CreateObject[] $createObjects */
        $createObjects = [];
        try {
            $params = new Params($this->request);
        } catch(Exception $e) {
            $this->handleError($e);
            return $createObjects;
        }
        $postParams = $params->getParams();
        if(!is_array($postParams)) {
            $postParams = [$postParams];
        }
        foreach($postParams as $postParam) {
            $createObject = new CreateObject($postParam);
            try {
                $entity = $this->createActionInternal($postParam);
                $createObject->setEntity($entity);

            } catch(Exception $e) {
                $this->handleError($e);
            } catch(ValidationException $e) {
                $this->handleValidationError($e);
            } catch(AclException $e) {
                $this->handleAclError($e);
            } catch(CatchableException $e) {
                $this->handleCatchableError($e);
            }
            $createObject->setStatusCode($this->getStatusCode());
            $createObject->setErrors($this->getErrors());
            $this->setErrors([]);
            $createObjects[] = $createObject;
        }
        return $createObjects;
    }
private function createActionProcess() {
        /** @var CreateObject[] $createObjects */
        $createObjects = [];
        try {
            $params = new Params($this->request);
        } catch(Exception $e) {
            $this->handleError($e);
            return $createObjects;
        }
        $postParams = $params->getParams();
        if(!is_array($postParams)) {
            $postParams = [$postParams];
        }
        foreach($postParams as $postParam) {
            $createObject = new CreateObject($postParam);
            try {
                $entity = $this->createActionInternal($postParam);
                $createObject->setEntity($entity);

            } catch(Exception $e) {
                $this->handleError($e);
            } catch(ValidationException $e) {
                $this->handleValidationError($e);
            } catch(AclException $e) {
                $this->handleAclError($e);
            } catch(CatchableException $e) {
                $this->handleCatchableError($e);
            }
            $createObject->setStatusCode($this->getStatusCode());
            $createObject->setErrors($this->getErrors());
            $this->setErrors([]);
            $createObjects[] = $createObject;
        }
        return $createObjects;
    }
private function createActionProcess ( ) { /** @var CreateObject[] $createObjects */ $ createObjects = [ ] ; try { $ params = new Params ( $ this -> request ) ; } catch ( Exception $ e ) { $ this -> handleError ( $ e ) ; return $ createObjects ; } $ postParams = $ params -> getParams ( ) ; if ( ! is_array ( $ postParams ) ) { $ postParams = [ $ postParams ] ; } foreach ( $ postParams as $ postParam ) { $ createObject = new CreateObject ( $ postParam ) ; try { $ entity = $ this -> createActionInternal ( $ postParam ) ; $ createObject -> setEntity ( $ entity ) ; } catch ( Exception $ e ) { $ this -> handleError ( $ e ) ; } catch ( ValidationException $ e ) { $ this -> handleValidationError ( $ e ) ; } catch ( AclException $ e ) { $ this -> handleAclError ( $ e ) ; } catch ( CatchableException $ e ) { $ this -> handleCatchableError ( $ e ) ; } $ createObject -> setStatusCode ( $ this -> getStatusCode ( ) ) ; $ createObject -> setErrors ( $ this -> getErrors ( ) ) ; $ this -> setErrors ( [ ] ) ; $ createObjects [ ] = $ createObject ; } return $ createObjects ; }
Creates the entities, returns a list of createObjects, to process accordingly
@return \Bullhorn\FastRest\Api\Models\CreateObject[]
Creates the entities returns a list of createObjects to process accordingly