public function update($table, $columns, $condition = '', $params = [])
    {
        $sql = $this->db->getQueryBuilder()->update($table, $columns, $condition, $params);

        return $this->setSql($sql)->bindValues($params);
    }
public function update($table, $columns, $condition = '', $params = [])
    {
        $sql = $this->db->getQueryBuilder()->update($table, $columns, $condition, $params);

        return $this->setSql($sql)->bindValues($params);
    }
public function update ( $ table , $ columns , $ condition = '' , $ params = [ ] ) { $ sql = $ this -> db -> getQueryBuilder ( ) -> update ( $ table , $ columns , $ condition , $ params ) ; return $ this -> setSql ( $ sql ) -> bindValues ( $ params ) ; }
Creates an UPDATE command.

For example,

```php
$connection->createCommand()->update('user', ['status' => 1], 'age > 30')->execute();
```

or with using parameter binding for the condition:

```php
$minAge = 30;
$connection->createCommand()->update('user', ['status' => 1], 'age > :minAge', [':minAge' => $minAge])->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 [[execute()]] is called.

@param string $table the table to be updated.
@param array $columns the column data (name => value) to be updated.
@param string|array $condition the condition that will be put in the WHERE part. Please
refer to [[Query::where()]] on how to specify condition.
@param array $params the parameters to be bound to the command
@return $this the command object itself
Creates an UPDATE command .