protected function SqliteProfilerStorage::fetch

Overrides PdoProfilerStorage::fetch

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php, line 75

Class

SqliteProfilerStorage
SqliteProfilerStorage stores profiling information in a SQLite database.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

protected function fetch($db, $query, array $args = array()) {
  $return = array();
  if ($db instanceof \SQLite3) {
    $stmt = $this
      ->prepareStatement($db, $query, true);
    foreach ($args as $arg => $val) {
      $stmt
        ->bindValue($arg, $val, is_int($val) ? \SQLITE3_INTEGER : \SQLITE3_TEXT);
    }
    $res = $stmt
      ->execute();
    while ($row = $res
      ->fetchArray(\SQLITE3_ASSOC)) {
      $return[] = $row;
    }
    $res
      ->finalize();
    $stmt
      ->close();
  }
  else {
    $return = parent::fetch($db, $query, $args);
  }
  return $return;
}