class EntityViewAlterEvent in Hook Event Dispatcher 8
Class EntityViewAlterEventEvent.
Hierarchy
- class \Drupal\hook_event_dispatcher\Event\Entity\BaseEntityEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
- class \Drupal\hook_event_dispatcher\Event\Entity\EntityViewAlterEvent
Expanded class hierarchy of EntityViewAlterEvent
2 files declare their use of EntityViewAlterEvent
- EntityViewEventTest.php in tests/
src/ Unit/ Entity/ EntityViewEventTest.php - hook_event_dispatcher.module in ./
hook_event_dispatcher.module - Hook event dispatcher module.
File
- src/
Event/ Entity/ EntityViewAlterEvent.php, line 12
Namespace
Drupal\hook_event_dispatcher\Event\EntityView source
class EntityViewAlterEvent extends BaseEntityEvent {
/**
* A renderable array representing the entity content.
*
* @var array
*/
protected $build;
/**
* The entity view display.
*
* @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface
*/
protected $display;
/**
* EntityViewAlterEventEvent constructor.
*
* @param array &$build
* A renderable array representing the entity content. The module may add
* elements to $build prior to rendering. The structure of $build is a
* renderable array as expected by drupal_render().
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object.
* @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
* The entity view display holding the display options configured for the
* entity components.
*/
public function __construct(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
parent::__construct($entity);
$this->build =& $build;
$this->display = $display;
}
/**
* Get the build.
*
* @return array
* The build.
*/
public function &getBuild() {
return $this->build;
}
/**
* Get the display.
*
* @return \Drupal\Core\Entity\Display\EntityViewDisplayInterface
* The display.
*/
public function getDisplay() {
return $this->display;
}
/**
* {@inheritdoc}
*/
public function getDispatcherType() {
return HookEventDispatcherInterface::ENTITY_VIEW_ALTER;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BaseEntityEvent:: |
protected | property | The Entity. | |
BaseEntityEvent:: |
public | function | Get the Entity. | |
BaseEntityEvent:: |
public | function | Set the Entity. | |
EntityViewAlterEvent:: |
protected | property | A renderable array representing the entity content. | |
EntityViewAlterEvent:: |
protected | property | The entity view display. | |
EntityViewAlterEvent:: |
public | function | Get the build. | |
EntityViewAlterEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
EntityViewAlterEvent:: |
public | function | Get the display. | |
EntityViewAlterEvent:: |
public | function |
EntityViewAlterEventEvent constructor. Overrides BaseEntityEvent:: |