class EntityBuildDefaultsAlterEvent in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/src/Event/Entity/EntityBuildDefaultsAlterEvent.php \Drupal\core_event_dispatcher\Event\Entity\EntityBuildDefaultsAlterEvent
Class EntityBuildDefaultsAlterEvent.
Hierarchy
- class \Drupal\core_event_dispatcher\Event\Entity\AbstractEntityEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
- class \Drupal\core_event_dispatcher\Event\Entity\EntityBuildDefaultsAlterEvent
Expanded class hierarchy of EntityBuildDefaultsAlterEvent
2 files declare their use of EntityBuildDefaultsAlterEvent
- core_event_dispatcher.module in modules/
core_event_dispatcher/ core_event_dispatcher.module - Core event dispatcher submodule.
- EntityViewEventTest.php in modules/
core_event_dispatcher/ tests/ src/ Unit/ Entity/ EntityViewEventTest.php
File
- modules/
core_event_dispatcher/ src/ Event/ Entity/ EntityBuildDefaultsAlterEvent.php, line 11
Namespace
Drupal\core_event_dispatcher\Event\EntityView source
class EntityBuildDefaultsAlterEvent extends AbstractEntityEvent {
/**
* A renderable array representing the entity content.
*
* @var array
*/
private $build;
/**
* The view mode.
*
* @var string
*/
private $viewMode;
/**
* EntityBuildDefaultsAlterEvent constructor.
*
* @param array &$build
* A renderable array representing the entity content. It will not have
* other elements aside from the entity and a #cache parameter. The
* structure of $build is a renderable array as expected by drupal_render().
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object.
* @param string $viewMode
* The view mode the entity is rendered in.
*/
public function __construct(array &$build, EntityInterface $entity, string $viewMode) {
parent::__construct($entity);
$this->build =& $build;
$this->viewMode = $viewMode;
}
/**
* Get the build.
*
* @return array
* The build.
*/
public function &getBuild() : array {
return $this->build;
}
/**
* Get the view mode.
*
* @return string
* The view mode.
*/
public function getViewMode() : string {
return $this->viewMode;
}
/**
* {@inheritdoc}
*/
public function getDispatcherType() : string {
return HookEventDispatcherInterface::ENTITY_BUILD_DEFAULTS_ALTER;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractEntityEvent:: |
protected | property | The Entity. | |
AbstractEntityEvent:: |
public | function | Get the Entity. | |
EntityBuildDefaultsAlterEvent:: |
private | property | A renderable array representing the entity content. | |
EntityBuildDefaultsAlterEvent:: |
private | property | The view mode. | |
EntityBuildDefaultsAlterEvent:: |
public | function | Get the build. | |
EntityBuildDefaultsAlterEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
EntityBuildDefaultsAlterEvent:: |
public | function | Get the view mode. | |
EntityBuildDefaultsAlterEvent:: |
public | function |
EntityBuildDefaultsAlterEvent constructor. Overrides AbstractEntityEvent:: |