function BlocksDataCollector::collect

File

webprofiler/src/DataCollector/BlocksDataCollector.php, line 40

Class

BlocksDataCollector
Class BlocksDataCollector

Namespace

Drupal\webprofiler\DataCollector

Code

public function collect(Request $request, Response $response, \Exception $exception = NULL) {
    $storage = $this->entityManager
        ->getStorage('block');
    $loaded = $this->entityManager
        ->getLoaded('config', 'block');
    $rendered = $this->entityManager
        ->getRendered('block');
    if ($loaded) {
        $this->data['blocks']['loaded'] = $this->getBlocksData($loaded, $storage);
    }
    if ($rendered) {
        $this->data['blocks']['rendered'] = $this->getBlocksData($rendered, $storage);
    }
}