yii2tech\ar\softdelete\SoftDeleteBehavior::softDelete PHP 메소드

softDelete() 공개 메소드

Marks the owner as deleted.
public softDelete ( ) : integer | false
리턴 integer | false the number of rows marked as deleted, or false if the soft deletion is unsuccessful for some reason. Note that it is possible the number of rows deleted is 0, even though the soft deletion execution is successful.
    public function softDelete()
    {
        if ($this->isDeleteAllowed()) {
            return $this->owner->delete();
        }
        if ($this->invokeDeleteEvents && !$this->owner->beforeDelete()) {
            return false;
        }
        $result = $this->softDeleteInternal();
        if ($this->invokeDeleteEvents) {
            $this->owner->afterDelete();
        }
        return $result;
    }