You are here

public function Insert::__toString in Drupal driver for SQL Server and SQL Azure 3.1.x

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

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

Return value

string The prepared statement.

Overrides Insert::__toString

File

src/Driver/Database/sqlsrv/Insert.php, line 183

Class

Insert
Sql Server implementation of \Drupal\Core\Database\Query\Insert.

Namespace

Drupal\sqlsrv\Driver\Database\sqlsrv

Code

public function __toString() {

  // Default to a query that inserts everything at the same time.
  return $this
    ->buildQuery(count($this->insertValues));
}