You are here

public function Statement::BindExpressions in Drupal driver for SQL Server and SQL Azure 8.2

Summary of BindExpressions

Parameters

array $values:

array $remove_from:

File

drivers/lib/Drupal/Driver/Database/sqlsrv/PDO/Statement.php, line 238

Class

Statement
Turbocharged Statement class to work with MSSQL server.

Namespace

Drupal\Driver\Database\sqlsrv\PDO

Code

public function BindExpressions(array &$values, array &$remove_from) {
  foreach ($values as $key => $value) {
    unset($remove_from[$key]);
    if (empty($value['arguments'])) {
      continue;
    }
    if (is_array($value['arguments'])) {
      foreach ($value['arguments'] as $placeholder => $argument) {

        // We assume that an expression will never happen on a BLOB field,
        // which is a fairly safe assumption to make since in most cases
        // it would be an invalid query anyway.
        $this
          ->bindParam($placeholder, $value['arguments'][$placeholder]);
      }
    }
    else {
      $this
        ->bindParam($key, $value['arguments'], PDO::PARAM_STR);
    }
  }
}