elasticsearch\ActiveRecord deleteAll()

deleteAll() public static method

Deletes rows in the table 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]);

See also [[yii\elasticsearch\ActiveRecord::primaryKeysByCondition()]].

public static integer deleteAll ( $condition = [] )
$condition array

The conditions that will be passed to the where() method when building the query. Please refer to yii\elasticsearch\ActiveQuery::where() on how to specify this parameter.

return integer

The number of rows deleted

throws yii\elasticsearch\Exception

on error.

doc_Yii
2016-10-30 17:01:21
Comments
Leave a Comment

Please login to continue.