class ViewsPerformanceAnalyzerSubscriber in Entity Pager 8
Same name and namespace in other branches
- 2.0.x src/EventSubscriber/ViewsPerformanceAnalyzerSubscriber.php \Drupal\entity_pager\EventSubscriber\ViewsPerformanceAnalyzerSubscriber
An event subscriber to provide performance feedback on the Entity Pager view.
Hierarchy
- class \Drupal\entity_pager\EventSubscriber\ViewsPerformanceAnalyzerSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of ViewsPerformanceAnalyzerSubscriber
File
- src/
EventSubscriber/ ViewsPerformanceAnalyzerSubscriber.php, line 12
Namespace
Drupal\entity_pager\EventSubscriberView source
class ViewsPerformanceAnalyzerSubscriber implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events = [];
$events[EntityPagerEvents::ENTITY_PAGER_ANALYZE][] = [
'onEntityPagerAnalyze',
];
return $events;
}
/**
* Analyzes the entity pager view for performance issues and provide feedback.
*
* @param \Drupal\entity_pager\Event\EntityPagerAnalyzeEvent $event
* The Entity Pager Analyze event.
*/
public function onEntityPagerAnalyze(EntityPagerAnalyzeEvent $event) {
$options = $event
->getEntityPager()
->getOptions();
if (!$options['log_performance']) {
return;
}
// @todo Log performance issues about the view
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ViewsPerformanceAnalyzerSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
ViewsPerformanceAnalyzerSubscriber:: |
public | function | Analyzes the entity pager view for performance issues and provide feedback. |