Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function calculateDependencies()
 {
     $dependencies = parent::calculateDependencies();
     $style_id = $this->getSetting('image_style');
     /** @var \Drupal\image\ImageStyleInterface $style */
     if ($style_id && ($style = ImageStyle::load($style_id))) {
         // If this formatter uses a valid image style to display the image, add
         // the image style configuration entity as dependency of this formatter.
         $dependencies[$style->getConfigDependencyKey()][] = $style->getConfigDependencyName();
     }
     return $dependencies;
 }
 /**
  * {@inheritdoc}
  */
 public function calculateDependencies()
 {
     $dependencies = parent::calculateDependencies();
     $style_id = $this->getSetting('responsive_image_style');
     /** @var \Drupal\responsive_image\ResponsiveImageStyleInterface $style */
     if ($style_id && ($style = ResponsiveImageStyle::load($style_id))) {
         // Add the responsive image style as dependency.
         $dependencies[$style->getConfigDependencyKey()][] = $style->getConfigDependencyName();
     }
     return $dependencies;
 }