db\ActiveRecordInterface deleteAll()

deleteAll() public abstract static method

Deletes records using the provided conditions.

WARNING: If you do not specify any condition, this method will delete ALL rows in the table.

For example, to delete all customers whose status is 3:

Customer::deleteAll([status = 3]);
public abstract static integer deleteAll ( $condition = null )
$condition array

The condition that matches the records that should get deleted. Please refer to yii\db\QueryInterface::where() on how to specify this parameter. An empty condition will match all records.

return integer

The number of rows deleted

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

Please login to continue.