You are here

class SectionComponentDependenciesEvent in Dependency Calculation 8

The SectionComponentDependenciesEvent event.

Hierarchy

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\Event
View 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

Namesort descending Modifiers Type Description Overrides
SectionComponentDependenciesEvent::$component protected property The component for this event.
SectionComponentDependenciesEvent::$entityDependencies protected property The entity dependencies for this event.
SectionComponentDependenciesEvent::$moduleDependencies protected property The module dependencies for this event.
SectionComponentDependenciesEvent::addEntityDependency public function Adds an entity as dependency.
SectionComponentDependenciesEvent::addModuleDependency public function Adds a module as dependency.
SectionComponentDependenciesEvent::getComponent public function Get the event component.
SectionComponentDependenciesEvent::getEntityDependencies public function Get the entity dependencies for this event.
SectionComponentDependenciesEvent::getModuleDependencies public function Get the module dependencies for this event.
SectionComponentDependenciesEvent::__construct public function SectionComponentDependenciesEvent constructor.