Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResponsiveImageStyle.php

function ResponsiveImageStyle::calculateDependencies

Overrides ConfigEntityBase::calculateDependencies

File

core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php, line 235

Class

ResponsiveImageStyle
Defines the responsive image style entity.

Namespace

Drupal\responsive_image\Entity

Code

public function calculateDependencies() {
    parent::calculateDependencies();
    $providers = \Drupal::service('breakpoint.manager')->getGroupProviders($this->breakpoint_group);
    foreach ($providers as $provider => $type) {
        $this->addDependency($type, $provider);
    }
    // Extract all the styles from the image style mappings.
    $styles = ImageStyle::loadMultiple($this->getImageStyleIds());
    array_walk($styles, function ($style) {
        $this->addDependency('config', $style->getConfigDependencyName());
    });
    return $this;
}
RSS feed
Powered by Drupal