You are here

public function BlocksDataCollector::collect in Devel 8.2

Same name and namespace in other branches
  1. 8.3 webprofiler/src/DataCollector/BlocksDataCollector.php \Drupal\webprofiler\DataCollector\BlocksDataCollector::collect()
  2. 8 webprofiler/src/DataCollector/BlocksDataCollector.php \Drupal\webprofiler\DataCollector\BlocksDataCollector::collect()
  3. 4.x webprofiler/src/DataCollector/BlocksDataCollector.php \Drupal\webprofiler\DataCollector\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);
  }
}