You are here

public function LayoutBuilderEntityViewDisplay::calculateDependencies in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides EntityDisplayBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

File

core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php, line 383

Class

LayoutBuilderEntityViewDisplay
Provides an entity view display entity that has a layout.

Namespace

Drupal\layout_builder\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();
  foreach ($this
    ->getSections() as $delta => $section) {
    $this
      ->calculatePluginDependencies($section
      ->getLayout());
    foreach ($section
      ->getComponents() as $uuid => $component) {
      $this
        ->calculatePluginDependencies($component
        ->getPlugin());
    }
  }
  return $this;
}