public function replace($index, $columns)
    {
        $params = [];
        $sql = $this->db->getQueryBuilder()->replace($index, $columns, $params);

        return $this->setSql($sql)->bindValues($params);
    }
public function replace($index, $columns)
    {
        $params = [];
        $sql = $this->db->getQueryBuilder()->replace($index, $columns, $params);

        return $this->setSql($sql)->bindValues($params);
    }
public function replace ( $ index , $ columns ) { $ params = [ ] ; $ sql = $ this -> db -> getQueryBuilder ( ) -> replace ( $ index , $ columns , $ params ) ; return $ this -> setSql ( $ sql ) -> bindValues ( $ params ) ; }
Creates an REPLACE command.
For example,

```php
$connection->createCommand()->replace('idx_user', [
'name' => 'Sam',
'age' => 30,
])->execute();
```

The method will properly escape the column names, and bind the values to be replaced.

Note that the created command is not executed until [[execute()]] is called.

@param string $index the index that new rows will be replaced into.
@param array $columns the column data (name => value) to be replaced into the index.
@return $this the command object itself
Creates an REPLACE command . For example