public function PdoProfilerStorage::find

Finds profiler tokens for the given criteria.

Parameters

string $ip The IP:

string $url The URL:

string $limit The maximum number of tokens to return:

string $method The request method:

int|null $start The start date to search from:

int|null $end The end date to search to:

Return value

array An array of tokens

Overrides ProfilerStorageInterface::find

File

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

Class

PdoProfilerStorage
Base PDO storage for profiling information in a PDO database.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

public function find($ip, $url, $limit, $method, $start = null, $end = null) {
  if (null === $start) {
    $start = 0;
  }
  if (null === $end) {
    $end = time();
  }
  list($criteria, $args) = $this
    ->buildCriteria($ip, $url, $start, $end, $limit, $method);
  $criteria = $criteria ? 'WHERE ' . implode(' AND ', $criteria) : '';
  $db = $this
    ->initDb();
  $tokens = $this
    ->fetch($db, 'SELECT token, ip, method, url, time, parent FROM sf_profiler_data ' . $criteria . ' ORDER BY time DESC LIMIT ' . (int) $limit, $args);
  $this
    ->close($db);
  return $tokens;
}