yii\db\Command::update PHP Méthode

update() public méthode

For example, php $connection->createCommand()->update('user', ['status' => 1], 'age > 30')->execute(); The method will properly escape the column names and bind the values to be updated. Note that the created command is not executed until Command::execute is called.
public update ( string $table, array $columns, string | array $condition = '', array $params = [] )
$table string the table to be updated.
$columns array the column data (name => value) to be updated.
$condition string | array the condition that will be put in the WHERE part. Please refer to [[Query::where()]] on how to specify condition.
$params array the parameters to be bound to the command
    public function update($table, $columns, $condition = '', $params = [])
    {
        $sql = $this->db->getQueryBuilder()->update($table, $columns, $condition, $params);
        return $this->setSql($sql)->bindValues($params);
    }