You are here

public function Upsert::__toString in Drupal driver for SQL Server and SQL Azure 4.2.x

Same name and namespace in other branches
  1. 3.1.x src/Driver/Database/sqlsrv/Upsert.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Upsert::__toString()
  2. 4.0.x src/Driver/Database/sqlsrv/Upsert.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Upsert::__toString()
  3. 4.1.x src/Driver/Database/sqlsrv/Upsert.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Upsert::__toString()

Implements PHP magic __toString method to convert the query to a string.

The toString operation is how we compile a query object to a prepared statement.

Return value

string A prepared statement query string for this object.

Overrides Query::__toString

File

src/Driver/Database/sqlsrv/Upsert.php, line 85

Class

Upsert
Implements Native Upsert queries for MSSQL.

Namespace

Drupal\sqlsrv\Driver\Database\sqlsrv

Code

public function __toString() {
  return $this
    ->buildQuery(count($this->insertValues));
}