src/Torann/RemoteModel/Model.php
protected function performCreate(array $options = [])
    {
        if ($this->fireModelEvent('creating') === false) {
            return false;
        }

        $params = $this->setKeysForSave();

        $results = $this->makeRequest($this->getEndpoint(), 'create', [$params]);

        // Creation failed
        if (is_array($results) === false) {
            return false;
        }

        // Fresh start
        $this->attributes = [];

        // Update model with new data
        $this->fill($results);

        // We will go ahead and set the exists property to true, so that it is set when
        // the created event is fired, just in case the developer tries to update it
        // during the event. This will allow them to do so and run an update here.
        $this->exists = true;

        $this->fireModelEvent('created', false);

        return true;
    }
protected function performCreate(array $options = [])
    {
        if ($this->fireModelEvent('creating') === false) {
            return false;
        }

        $params = $this->setKeysForSave();

        $results = $this->makeRequest($this->getEndpoint(), 'create', [$params]);

        // Creation failed
        if (is_array($results) === false) {
            return false;
        }

        // Fresh start
        $this->attributes = [];

        // Update model with new data
        $this->fill($results);

        // We will go ahead and set the exists property to true, so that it is set when
        // the created event is fired, just in case the developer tries to update it
        // during the event. This will allow them to do so and run an update here.
        $this->exists = true;

        $this->fireModelEvent('created', false);

        return true;
    }
protected function performCreate ( array $ options = [ ] ) { if ( $ this -> fireModelEvent ( 'creating' ) === false ) { return false ; } $ params = $ this -> setKeysForSave ( ) ; $ results = $ this -> makeRequest ( $ this -> getEndpoint ( ) , 'create' , [ $ params ] ) ; // Creation failed if ( is_array ( $ results ) === false ) { return false ; } // Fresh start $ this -> attributes = [ ] ; // Update model with new data $ this -> fill ( $ results ) ; // We will go ahead and set the exists property to true, so that it is set when // the created event is fired, just in case the developer tries to update it // during the event. This will allow them to do so and run an update here. $ this -> exists = true ; $ this -> fireModelEvent ( 'created' , false ) ; return true ; }
Perform a model create operation.

@param  array $options
@return bool
Perform a model create operation .