ActiveRecord::delete PHP Method

delete() public method

Deletes the row corresponding to this active record.
public delete ( ) : boolean
return boolean whether the deletion is successful.
    public function delete()
    {
        if ($this->asa('workflow') !== null) {
            $this->changeStatus(self::STATUS_DELETED);
            return true;
            // prevents hard deletion
        }
        return parent::delete();
    }

Usage Example

Example #1
0
 public function delete()
 {
     Context::get('db')->start_transaction();
     // delete blog comment
     BlogComment::neo()->where('blog_id = ?', $this->id)->delete();
     // delete blog
     parent::delete();
     Context::get('db')->commit();
 }
All Usage Examples Of ActiveRecord::delete