public function EntityBuildDefaultsAlterEvent::__construct 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::__construct()
EntityBuildDefaultsAlterEvent constructor.
Parameters
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().
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
string $viewMode: The view mode the entity is rendered in.
Overrides AbstractEntityEvent::__construct
File
- modules/
core_event_dispatcher/ src/ Event/ Entity/ EntityBuildDefaultsAlterEvent.php, line 39
Class
- EntityBuildDefaultsAlterEvent
- Class EntityBuildDefaultsAlterEvent.
Namespace
Drupal\core_event_dispatcher\Event\EntityCode
public function __construct(array &$build, EntityInterface $entity, string $viewMode) {
parent::__construct($entity);
$this->build =& $build;
$this->viewMode = $viewMode;
}