You are here

public function MongoDbProfilerStorage::read in Zircon Profile 8

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

Reads data associated with the given token.

The method returns false if the token does not exist in the storage.

Parameters

string $token A token:

Return value

Profile The profile associated with token

Overrides ProfilerStorageInterface::read

File

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

Class

MongoDbProfilerStorage

Namespace

Symfony\Component\HttpKernel\Profiler

Code

public function read($token) {
  $profile = $this
    ->getMongo()
    ->findOne(array(
    '_id' => $token,
    'data' => array(
      '$exists' => true,
    ),
  ));
  if (null !== $profile) {
    $profile = $this
      ->createProfileFromData($this
      ->getData($profile));
  }
  return $profile;
}