public static updateAllCounters ( array $counters, array $condition = [], array $options = [] ) : integer | ||
$counters | array | the counters to be updated (attribute name => increment value). Use negative values if you want to decrement the counters. |
$condition | array | description of the objects to update. Please refer to [[Query::where()]] on how to specify this parameter. |
$options | array | list of options in format: optionName => optionValue. |
return | integer | the number of documents updated. |
public static function updateAllCounters($counters, $condition = [], $options = [])
{
return static::getCollection()->update($condition, ['$inc' => $counters], $options);
}