You are here

protected function MongoDbProfilerStorage::createProfileFromData 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::createProfileFromData()

Parameters

array $data:

Return value

Profile

1 call to MongoDbProfilerStorage::createProfileFromData()
MongoDbProfilerStorage::read in vendor/symfony/http-kernel/Profiler/MongoDbProfilerStorage.php
Reads data associated with the given token.

File

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

Class

MongoDbProfilerStorage

Namespace

Symfony\Component\HttpKernel\Profiler

Code

protected function createProfileFromData(array $data) {
  $profile = $this
    ->getProfile($data);
  if ($data['parent']) {
    $parent = $this
      ->getMongo()
      ->findOne(array(
      '_id' => $data['parent'],
      'data' => array(
        '$exists' => true,
      ),
    ));
    if ($parent) {
      $profile
        ->setParent($this
        ->getProfile($this
        ->getData($parent)));
    }
  }
  $profile
    ->setChildren($this
    ->readChildren($data['token']));
  return $profile;
}