You are here

public function EntityAnalyzerSubscriber::onEntityPagerAnalyze in Entity Pager 8

Same name and namespace in other branches
  1. 2.0.x src/EventSubscriber/EntityAnalyzerSubscriber.php \Drupal\entity_pager\EventSubscriber\EntityAnalyzerSubscriber::onEntityPagerAnalyze()

Checks if there is a valid entity for the pager.

Parameters

\Drupal\entity_pager\Event\EntityPagerAnalyzeEvent $event: The analyze event.

File

src/EventSubscriber/EntityAnalyzerSubscriber.php, line 31

Class

EntityAnalyzerSubscriber
Provides feedback about the current entity used by the entity pager.

Namespace

Drupal\entity_pager\EventSubscriber

Code

public function onEntityPagerAnalyze(EntityPagerAnalyzeEvent $event) {
  $entity = $event
    ->getEntityPager()
    ->getEntity();
  if (!$entity) {
    $event
      ->log('No Entity on page.');
  }
}