class EntityPagerAnalyzer in Entity Pager 8
Same name and namespace in other branches
- 2.0.x src/EntityPagerAnalyzer.php \Drupal\entity_pager\EntityPagerAnalyzer
A class for analyzing an entity pager and providing feedback.
Hierarchy
- class \Drupal\entity_pager\EntityPagerAnalyzer implements EntityPagerAnalyzerInterface
Expanded class hierarchy of EntityPagerAnalyzer
1 file declares its use of EntityPagerAnalyzer
- EntityPagerAnalyzerTest.php in tests/
src/ Unit/ EntityPagerAnalyzerTest.php
File
- src/
EntityPagerAnalyzer.php, line 12
Namespace
Drupal\entity_pagerView source
class EntityPagerAnalyzer implements EntityPagerAnalyzerInterface {
/**
* The event dispatcher.
*
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
protected $eventDispatcher;
/**
* Constructs a new EntityPagerAnalyzer object.
*
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
* The event dispatcher.
*/
public function __construct(EventDispatcherInterface $eventDispatcher) {
$this->eventDispatcher = $eventDispatcher;
}
/**
* {@inheritdoc}
*/
public function analyze(EntityPagerInterface $entityPager) {
$event = new EntityPagerAnalyzeEvent($entityPager);
$this->eventDispatcher
->dispatch(EntityPagerEvents::ENTITY_PAGER_ANALYZE, $event);
$logs = $event
->getLogs();
foreach ($logs as $message) {
\Drupal::logger('entity_pager')
->notice($message);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityPagerAnalyzer:: |
protected | property | The event dispatcher. | |
EntityPagerAnalyzer:: |
public | function |
Analyzes the given entity pager. Overrides EntityPagerAnalyzerInterface:: |
|
EntityPagerAnalyzer:: |
public | function | Constructs a new EntityPagerAnalyzer object. |