public ConfigEntityBase::calculateDependencies()
Calculates dependencies and stores them in the dependency property.
Return value
$this
Overrides ConfigEntityInterface::calculateDependencies
See also
\Drupal\Core\Config\Entity\ConfigDependencyManager
File
- core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php, line 379
Class
- ConfigEntityBase
- Defines a base configuration entity class.
Namespace
Drupal\Core\Config\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | public function calculateDependencies() { // All dependencies should be recalculated on every save apart from enforced // dependencies. This ensures stale dependencies are never saved. $this ->dependencies = array_intersect_key ( $this ->dependencies, [ 'enforced' => '' ]); if ( $this instanceof EntityWithPluginCollectionInterface) { // Configuration entities need to depend on the providers of any plugins // that they store the configuration for. foreach ( $this ->getPluginCollections() as $plugin_collection ) { foreach ( $plugin_collection as $instance ) { $this ->calculatePluginDependencies( $instance ); } } } if ( $this instanceof ThirdPartySettingsInterface) { // Configuration entities need to depend on the providers of any third // parties that they store the configuration for. foreach ( $this ->getThirdPartyProviders() as $provider ) { $this ->addDependency( 'module' , $provider ); } } return $this ; } |
Please login to continue.