You are here

protected function SqliteProfilerStorage::fetch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Profiler/SqliteProfilerStorage.php \Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage::fetch()

Overrides PdoProfilerStorage::fetch

File

vendor/symfony/http-kernel/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;
}