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 |
return | integer |
The number of rows updated |
throws | yii\elasticsearch\Exception |
on error. |
Please login to continue.