You are here

class EntityPagerAnalyzeEvent in Entity Pager 8

Same name and namespace in other branches
  1. 2.0.x src/Event/EntityPagerAnalyzeEvent.php \Drupal\entity_pager\Event\EntityPagerAnalyzeEvent

Analyze event object.

Hierarchy

Expanded class hierarchy of EntityPagerAnalyzeEvent

6 files declare their use of EntityPagerAnalyzeEvent
EntityAnalyzerSubscriber.php in src/EventSubscriber/EntityAnalyzerSubscriber.php
EntityAnalyzerSubscriberTest.php in tests/src/Unit/EntityAnalyzerSubscriberTest.php
EntityPagerAnalyzeEventTest.php in tests/src/Unit/EntityPagerAnalyzeEventTest.php
EntityPagerAnalyzer.php in src/EntityPagerAnalyzer.php
EntityPagerAnalyzerTest.php in tests/src/Unit/EntityPagerAnalyzerTest.php

... See full list

File

src/Event/EntityPagerAnalyzeEvent.php, line 11

Namespace

Drupal\entity_pager\Event
View source
class EntityPagerAnalyzeEvent extends Event {

  /**
   * The entity pager being analyzed.
   *
   * @var \Drupal\entity_pager\EntityPagerInterface
   */
  protected $entityPager;

  /**
   * The log messages supplied.
   *
   * @var array
   */
  protected $logs = [];

  /**
   * Constructs a new EntityPagerAnalyzeEvent.
   *
   * @param \Drupal\entity_pager\EntityPagerInterface $entityPager
   *   The entity pager.
   */
  public function __construct(EntityPagerInterface $entityPager) {
    $this->entityPager = $entityPager;
  }

  /**
   * Gets the entity pager.
   *
   * @return \Drupal\entity_pager\EntityPagerInterface
   *   The entity pager.
   */
  public function getEntityPager() {
    return $this->entityPager;
  }

  /**
   * Sets the entity pager.
   *
   * @param \Drupal\entity_pager\EntityPagerInterface $entityPager
   *   The entity pager.
   */
  public function setEntityPager(EntityPagerInterface $entityPager) {
    $this->entityPager = $entityPager;
  }

  /**
   * Gets the logs array.
   *
   * @return array
   *   The logs array.
   */
  public function getLogs() {
    return $this->logs;
  }

  /**
   * Sets the logs array.
   *
   * @param array $logs
   *   The logs array.
   */
  public function setLogs(array $logs) {
    $this->logs = $logs;
  }

  /**
   * Logs one or more messages.
   *
   * @param array|string $messages
   *   One or more messages to log.
   */
  public function log($messages) {
    foreach ((array) $messages as $message) {
      $this->logs[] = $message;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityPagerAnalyzeEvent::$entityPager protected property The entity pager being analyzed.
EntityPagerAnalyzeEvent::$logs protected property The log messages supplied.
EntityPagerAnalyzeEvent::getEntityPager public function Gets the entity pager.
EntityPagerAnalyzeEvent::getLogs public function Gets the logs array.
EntityPagerAnalyzeEvent::log public function Logs one or more messages.
EntityPagerAnalyzeEvent::setEntityPager public function Sets the entity pager.
EntityPagerAnalyzeEvent::setLogs public function Sets the logs array.
EntityPagerAnalyzeEvent::__construct public function Constructs a new EntityPagerAnalyzeEvent.