LMongo\Eloquent\Model::performUpdate PHP Méthode

performUpdate() protected méthode

Perform a model update operation.
protected performUpdate ( $query ) : boolean
Résultat boolean
    protected function performUpdate($query)
    {
        $dirty = $this->getDirty();
        if (count($dirty) > 0) {
            // If the updating event returns false, we will cancel the update operation so
            // developers can hook Validation systems into their models and cancel this
            // operation if the model does not pass validation. Otherwise, we update.
            if ($this->fireModelEvent('updating') === false) {
                return false;
            }
            // First we need to create a fresh query instance and touch the creation and
            // update timestamp on the model which are maintained by us for developer
            // convenience. Then we will just continue saving the model instances.
            if ($this->timestamps) {
                $this->updateTimestamps();
                $dirty = $this->getDirty();
            }
            // Once we have run the update operation, we will fire the "updated" event for
            // this model instance. This will allow developers to hook into these after
            // models are updated, giving them a chance to do any special processing.
            $this->setKeysForSaveQuery($query)->update($dirty);
            $this->fireModelEvent('updated', false);
        }
        return true;
    }
Model