You are here

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

1 call to Statement::doExecute()
Statement::execute in drivers/lib/Drupal/Driver/Database/sqlsrv/Statement.php
Execute a statement.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Statement.php, line 77
Definition of Drupal\Driver\Database\sqlsrv\Statement

Class

Statement

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function doExecute($args = [], $options = []) {
  if (isset($options['fetch'])) {
    if (is_string($options['fetch'])) {

      // \PDO::FETCH_PROPS_LATE tells __construct() to run before properties
      // are added to the object.
      $this
        ->setFetchMode(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, $options['fetch']);
    }
    else {
      $this
        ->setFetchMode($options['fetch']);
    }
  }
  $logger = $this->dbh
    ->getLogger();
  if (!empty($logger)) {
    $query_start = microtime(true);
  }
  $return = parent::execute($args);
  if (!empty($logger)) {
    $query_end = microtime(true);
    $logger
      ->log($this, $args, $query_end - $query_start);
  }
  return $return;
}