protected function LayoutBuilderDependencyCollectorBase::addSectionDependencies in Dependency Calculation 8
Set module dependencies to the event.
Parameters
\Drupal\depcalc\Event\CalculateEntityDependenciesEvent $event: The calculate entity dependencies event.
\Drupal\layout_builder\Section $section: The section.
Throws
\Drupal\Component\Plugin\Exception\PluginNotFoundException
2 calls to LayoutBuilderDependencyCollectorBase::addSectionDependencies()
- LayoutBuilderEntityViewDisplayDependencyCollector::onCalculateDependencies in src/
EventSubscriber/ DependencyCollector/ LayoutBuilderEntityViewDisplayDependencyCollector.php - Calculates the entities referenced in Layout Builder components.
- LayoutBuilderFieldDependencyCollector::onCalculateDependencies in src/
EventSubscriber/ DependencyCollector/ LayoutBuilderFieldDependencyCollector.php - Calculates the entities referenced on Layout Builder components.
File
- src/
EventSubscriber/ LayoutBuilderComponentDepencyCollector/ LayoutBuilderDependencyCollectorBase.php, line 53
Class
Namespace
Drupal\depcalc\EventSubscriber\LayoutBuilderComponentDepencyCollectorCode
protected function addSectionDependencies(CalculateEntityDependenciesEvent $event, Section $section) {
$layout_id = $section
->getLayoutId();
$layout_plugin_definition = $this->layoutPluginManager
->getDefinition($layout_id);
$event
->setModuleDependencies([
$layout_plugin_definition
->getProvider(),
]);
}