db\BaseActiveRecord beforeDelete()

beforeDelete() public method

This method is invoked before deleting a record.

The default implementation raises the EVENT_BEFORE_DELETE event. When overriding this method, make sure you call the parent implementation like the following:

public function beforeDelete()
{
    if (parent::beforeDelete()) {
        // ...custom code here...
        return true;
    } else {
        return false;
    }
}
public boolean beforeDelete ( )
return boolean

Whether the record should be deleted. Defaults to true.

doc_Yii
2016-10-30 16:56:37
Comments
Leave a Comment

Please login to continue.