You are here

class EntityOperationAlterEvent in Hook Event Dispatcher 8

Class EntityOperationAlterEvent.

Hierarchy

Expanded class hierarchy of EntityOperationAlterEvent

2 files declare their use of EntityOperationAlterEvent
EntityOperationsTest.php in tests/src/Unit/Entity/EntityOperationsTest.php
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.

File

src/Event/Entity/EntityOperationAlterEvent.php, line 13

Namespace

Drupal\hook_event_dispatcher\Event\Entity
View source
class EntityOperationAlterEvent extends Event implements EventInterface {

  /**
   * The operations.
   *
   * @var array
   */
  private $operations;

  /**
   * The entity.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  private $entity;

  /**
   * EntityOperationAlterEvent constructor.
   *
   * @param array $operations
   *   The array of operations being altered.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   */
  public function __construct(array &$operations, EntityInterface $entity) {
    $this->operations =& $operations;
    $this->entity = $entity;
  }

  /**
   * Get the operations.
   *
   * Returned by reference to be modified.
   *
   * @return array
   *   The operations.
   */
  public function &getOperations() {
    return $this->operations;
  }

  /**
   * Get the entity.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   The entity.
   */
  public function getEntity() {
    return $this->entity;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::ENTITY_OPERATION_ALTER;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityOperationAlterEvent::$entity private property The entity.
EntityOperationAlterEvent::$operations private property The operations.
EntityOperationAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
EntityOperationAlterEvent::getEntity public function Get the entity.
EntityOperationAlterEvent::getOperations public function Get the operations.
EntityOperationAlterEvent::__construct public function EntityOperationAlterEvent constructor.