You are here

private function MongoDbProfilerStorage::buildQuery in Zircon Profile 8.0

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

Parameters

string $ip:

string $url:

string $method:

int $start:

int $end:

Return value

array

File

vendor/symfony/http-kernel/Profiler/MongoDbProfilerStorage.php, line 170

Class

MongoDbProfilerStorage

Namespace

Symfony\Component\HttpKernel\Profiler

Code

private function buildQuery($ip, $url, $method, $start, $end) {
  $query = array();
  if (!empty($ip)) {
    $query['ip'] = $ip;
  }
  if (!empty($url)) {
    $query['url'] = $url;
  }
  if (!empty($method)) {
    $query['method'] = $method;
  }
  if (!empty($start) || !empty($end)) {
    $query['time'] = array();
  }
  if (!empty($start)) {
    $query['time']['$gte'] = $start;
  }
  if (!empty($end)) {
    $query['time']['$lte'] = $end;
  }
  return $query;
}