function LayoutDefault::calculateDependencies

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Layout/LayoutDefault.php \Drupal\Core\Layout\LayoutDefault::calculateDependencies()
  2. 8.9.x core/lib/Drupal/Core/Layout/LayoutDefault.php \Drupal\Core\Layout\LayoutDefault::calculateDependencies()
  3. 11.x core/lib/Drupal/Core/Layout/LayoutDefault.php \Drupal\Core\Layout\LayoutDefault::calculateDependencies()

Calculates dependencies for the configured plugin.

Dependencies are saved in the plugin's configuration entity and are used to determine configuration synchronization order. For example, if the plugin integrates with specific user roles, this method should return an array of dependencies listing the specified roles.

Return value

array An array of dependencies grouped by type (config, content, module, theme). For example:

[
  'config' => [
    'user.role.anonymous',
    'user.role.authenticated',
  ],
  'content' => [
    'node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d',
  ],
  'module' => [
    'node',
    'user',
  ],
  'theme' => [
    'claro',
  ],
];

Overrides DependentPluginInterface::calculateDependencies

1 call to LayoutDefault::calculateDependencies()
TestLayoutMainFooter::calculateDependencies in core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php
2 methods override LayoutDefault::calculateDependencies()
LayoutTestDependenciesPlugin::calculateDependencies in core/modules/system/tests/modules/layout_test/src/Plugin/Layout/LayoutTestDependenciesPlugin.php
TestLayoutMainFooter::calculateDependencies in core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php

File

core/lib/Drupal/Core/Layout/LayoutDefault.php, line 90

Class

LayoutDefault
Provides a default class for Layout plugins.

Namespace

Drupal\Core\Layout

Code

public function calculateDependencies() {
  return [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.