class SectionComponentDependenciesEvent in Dependency Calculation 8
The SectionComponentDependenciesEvent event.
Hierarchy
- class \Drupal\depcalc\Event\SectionComponentDependenciesEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of SectionComponentDependenciesEvent
5 files declare their use of SectionComponentDependenciesEvent
- BlockContentDependencyCollector.php in src/
EventSubscriber/ LayoutBuilderComponentDepencyCollector/ BlockContentDependencyCollector.php - ConfigDependencyCollector.php in src/
EventSubscriber/ LayoutBuilderComponentDepencyCollector/ ConfigDependencyCollector.php - InlineBlockDependencyCollector.php in src/
EventSubscriber/ LayoutBuilderComponentDepencyCollector/ InlineBlockDependencyCollector.php - LayoutBuilderDependencyCollectorBase.php in src/
EventSubscriber/ LayoutBuilderComponentDepencyCollector/ LayoutBuilderDependencyCollectorBase.php - ModuleDependencyCollector.php in src/
EventSubscriber/ LayoutBuilderComponentDepencyCollector/ ModuleDependencyCollector.php
File
- src/
Event/ SectionComponentDependenciesEvent.php, line 12
Namespace
Drupal\depcalc\EventView source
class SectionComponentDependenciesEvent extends Event {
/**
* The component for this event.
*
* @var \Drupal\layout_builder\SectionComponent
*/
protected $component;
/**
* The entity dependencies for this event.
*
* @var \Drupal\Core\Entity\EntityInterface[]
*/
protected $entityDependencies;
/**
* The module dependencies for this event.
*
* @var string[]
*/
protected $moduleDependencies;
/**
* SectionComponentDependenciesEvent constructor.
*
* @param \Drupal\layout_builder\SectionComponent $component
* The section component.
*/
public function __construct(SectionComponent $component) {
$this->component = $component;
}
/**
* Get the event component.
*
* @return \Drupal\layout_builder\SectionComponent
* The section component.
*/
public function getComponent() {
return $this->component;
}
/**
* Get the entity dependencies for this event.
*
* @return \Drupal\Core\Entity\EntityInterface[]
* The entity dependencies.
*/
public function getEntityDependencies() {
return $this->entityDependencies ?: [];
}
/**
* Get the module dependencies for this event.
*
* @return string[]
* The module dependencies.
*/
public function getModuleDependencies() {
return $this->moduleDependencies ?: [];
}
/**
* Adds an entity as dependency.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
*/
public function addEntityDependency(EntityInterface $entity) {
$this->entityDependencies[] = $entity;
}
/**
* Adds a module as dependency.
*
* @param string $module
* The module.
*/
public function addModuleDependency(string $module) {
$this->moduleDependencies[] = $module;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SectionComponentDependenciesEvent:: |
protected | property | The component for this event. | |
SectionComponentDependenciesEvent:: |
protected | property | The entity dependencies for this event. | |
SectionComponentDependenciesEvent:: |
protected | property | The module dependencies for this event. | |
SectionComponentDependenciesEvent:: |
public | function | Adds an entity as dependency. | |
SectionComponentDependenciesEvent:: |
public | function | Adds a module as dependency. | |
SectionComponentDependenciesEvent:: |
public | function | Get the event component. | |
SectionComponentDependenciesEvent:: |
public | function | Get the entity dependencies for this event. | |
SectionComponentDependenciesEvent:: |
public | function | Get the module dependencies for this event. | |
SectionComponentDependenciesEvent:: |
public | function | SectionComponentDependenciesEvent constructor. |