LMongo\Eloquent\Model::isSoftDeleting PHP Method

isSoftDeleting() public method

Determine if the model instance uses soft deletes.
public isSoftDeleting ( ) : boolean
return boolean
    public function isSoftDeleting()
    {
        return $this->softDelete;
    }

Usage Example

示例#1
0
 /**
  * Restore the soft-deleted model instances.
  *
  * @return int
  */
 public function restore()
 {
     if ($this->model->isSoftDeleting()) {
         $column = $this->model->getDeletedAtColumn();
         return $this->update(array($column => null));
     }
 }
Model