LMongo\Eloquent\Model::delete PHP Method

delete() public method

Delete the model from the database.
public delete ( ) : boolean | null
return boolean | null
    public function delete()
    {
        if ($this->exists) {
            if ($this->fireModelEvent('deleting') === false) {
                return false;
            }
            // Here, we'll touch the owning models, verifying these timestamps get updated
            // for the models. This will allow any caching to get broken on the parents
            // by the timestamp. Then we will go ahead and delete the model instance.
            $this->touchOwners();
            $this->performDeleteOnModel();
            $this->exists = false;
            // Once the model has been deleted, we will fire off the deleted event so that
            // the developers may hook into post-delete operations. We will then return
            // a boolean true as the delete is presumably successful on the database.
            $this->fireModelEvent('deleted', false);
            return true;
        }
    }
Model