You are here

public function BlocksDataCollector::collect in Devel 4.x

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. 8.2 webprofiler/src/DataCollector/BlocksDataCollector.php \Drupal\webprofiler\DataCollector\BlocksDataCollector::collect()

File

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

Class

BlocksDataCollector
Class BlocksDataCollector.

Namespace

Drupal\webprofiler\DataCollector

Code

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