class EntityOperationAlterEvent in Hook Event Dispatcher 8
Class EntityOperationAlterEvent.
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\Entity\EntityOperationAlterEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
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\EntityView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityOperationAlterEvent:: |
private | property | The entity. | |
EntityOperationAlterEvent:: |
private | property | The operations. | |
EntityOperationAlterEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
EntityOperationAlterEvent:: |
public | function | Get the entity. | |
EntityOperationAlterEvent:: |
public | function | Get the operations. | |
EntityOperationAlterEvent:: |
public | function | EntityOperationAlterEvent constructor. |