elasticsearch\ActiveRecord updateAll()

updateAll() public static method

Updates all records whos primary keys are given.

For example, to change the status to be 1 for all customers whose status is 2:

Customer::updateAll(['status' => 1], ['status' => 2]);

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

public static integer updateAll ( $attributes, $condition = [] )
$attributes array

Attribute values (name-value pairs) to be saved into the table

$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 updated

throws yii\elasticsearch\Exception

on error.

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

Please login to continue.