original_string: public function replace($tableExpression, array $data, array $types = array())
      {
          $this->connect();
  
          if (empty($data)) {
              return $this->executeUpdate('REPLACE INTO ' . $tableExpression . ' ()' . ' VALUES ()');
          }
  
          return $this->executeUpdate(
              'REPLACE INTO ' . $tableExpression . ' (' . implode(', ', array_keys($data)) . ')' .
              ' VALUES (' . implode(', ', array_fill(0, count($data), '?')) . ')',
              array_values($data),
              is_string(key($types)) ? $this->extractTypeValues($data, $types) : $types
          );
      }
code: public function replace($tableExpression, array $data, array $types = array())
      {
          $this->connect();
  
          if (empty($data)) {
              return $this->executeUpdate('REPLACE INTO ' . $tableExpression . ' ()' . ' VALUES ()');
          }
  
          return $this->executeUpdate(
              'REPLACE INTO ' . $tableExpression . ' (' . implode(', ', array_keys($data)) . ')' .
              ' VALUES (' . implode(', ', array_fill(0, count($data), '?')) . ')',
              array_values($data),
              is_string(key($types)) ? $this->extractTypeValues($data, $types) : $types
          );
      }
code_tokens: public function replace ( $ tableExpression , array $ data , array $ types = array ( ) ) { $ this -> connect ( ) ; if ( empty ( $ data ) ) { return $ this -> executeUpdate ( 'REPLACE INTO ' . $ tableExpression . ' ()' . ' VALUES ()' ) ; } return $ this -> executeUpdate ( 'REPLACE INTO ' . $ tableExpression . ' (' . implode ( ', ' , array_keys ( $ data ) ) . ')' . ' VALUES (' . implode ( ', ' , array_fill ( 0 , count ( $ data ) , '?' ) ) . ')' , array_values ( $ data ) , is_string ( key ( $ types ) ) ? $ this -> extractTypeValues ( $ data , $ types ) : $ types ) ; }
docstring: Inserts a table row with specified data.
  REPLACE works exactly like INSERT, except that if an old row in the table has the same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the new row is inserted.
  
  Table expression and columns are not escaped and are not safe for user-input.
  
  @param string $tableExpression The expression of the table to insert data into, quoted or unquoted.
  @param array  $data      An associative array containing column-value pairs.
  @param array  $types     Types of the inserted data.
  
  @return integer The number of affected rows.
docstring_tokens: Inserts a table row with specified data . REPLACE works exactly like INSERT except that if an old row in the table has the same value as a new row for a PRIMARY KEY or a UNIQUE index the old row is deleted before the new row is inserted .