updateAllCounters() public static method
Updates the whole table using the provided counter changes and conditions.
For example, to increment all customers' age by 1,
Customer::updateAllCounters(['age' => 1]);
public static integer updateAllCounters ( $counters, $condition = null ) | ||
---|---|---|
$counters | array |
The counters to be updated (attribute name => increment value). Use negative values if you want to decrement the counters. |
$condition | array |
The conditions that will be put in the WHERE part of the UPDATE SQL. Please refer to yii\redis\ActiveQuery::where() on how to specify this parameter. |
return | integer |
The number of rows updated |
Please login to continue.