public static function updateAll($attributes, $condition = '', $params = [], $connection = null)
    {
        $command = static::getDb()->createCommand();
        $command->update(static::tableName(), $attributes, $condition, $params);
        if (isset($connection)) {
            $command->setConnection($connection);
        }

        return $command->execute();
    }
public static function updateAll($attributes, $condition = '', $params = [], $connection = null)
    {
        $command = static::getDb()->createCommand();
        $command->update(static::tableName(), $attributes, $condition, $params);
        if (isset($connection)) {
            $command->setConnection($connection);
        }

        return $command->execute();
    }
public static function updateAll ( $ attributes , $ condition = '' , $ params = [ ] , $ connection = null ) { $ command = static :: getDb ( ) -> createCommand ( ) ; $ command -> update ( static :: tableName ( ) , $ attributes , $ condition , $ params ) ; if ( isset ( $ connection ) ) { $ command -> setConnection ( $ connection ) ; } return $ command -> execute ( ) ; }
Updates the whole table using the provided attribute values and conditions.

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

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

> Warning: If you do not specify any condition, this method will update **all** rows in the table.

Note that this method will not trigger any events. If you need [[EVENT_BEFORE_UPDATE]] or
[[EVENT_AFTER_UPDATE]] to be triggered, you need to [[find()|find]] the models first and then
call [[update()]] on each of them. For example an equivalent of the example above would be:

```php
$models = Customer::find()->where('status = 2')->all();
foreach ($models as $model) {
$model->status = 1;
$model->update(false); // skipping validation as no user input is involved
}
```

For a large set of models you might consider using [[ActiveQuery::each()]] to keep memory usage within limits.

@param array                    $attributes attribute values (name-value pairs) to be saved into the table
@param string|array             $condition the conditions that will be put in the WHERE part of the UPDATE SQL.
Please refer to [[Query::where()]] on how to specify this parameter.
@param array                    $params the parameters (name => value) to be bound to the query.
@param ConnectionInterface|null $connection
@return LazyPromiseInterface with int the number of rows updated
Updates the whole table using the provided attribute values and conditions .