Baum\Extensions\Eloquent\Model::reload PHP Метод

reload() публичный Метод

Reloads the model from the database.
public reload ( ) : Node
Результат Baum\Node
    public function reload()
    {
        if ($this->exists || $this->areSoftDeletesEnabled() && $this->trashed()) {
            $fresh = $this->getFreshInstance();
            if (is_null($fresh)) {
                throw with(new ModelNotFoundException())->setModel(get_called_class());
            }
            $this->setRawAttributes($fresh->getAttributes(), true);
            $this->setRelations($fresh->getRelations());
            $this->exists = $fresh->exists;
        } else {
            // Revert changes if model is not persisted
            $this->attributes = $this->original;
        }
        return $this;
    }