phalcon softDelete : how to find

Hi,

I have successfully configured below softDelete and It works fine. But the find() method returns all the records. Do I need to override find() method to find([[ is_deleted => 0 ]]) ?

public function initialize() {
$this->addBehavior(new SoftDelete(
    array(
        'field' => 'is_deleted',
        'value' => 1
    )
)); 
}


991
edited 12d ago

When you use softdelete - you not delete rows in reallity. So you can't use :beforeDelete and :afterDelete. If you want find all "softdeleted" rows - you can do it:

Model::find("is_deleted=1");

or

Model::find(
    [
        'conditions' => 'is_deleted = ?1',
        'bind'       => [
            1 => 1,
        ]
    ]
);