コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function onDependencyRemoval(array $dependencies)
 {
     $changed = parent::onDependencyRemoval($dependencies);
     $style_id = $this->getSetting('image_style');
     if ($style_id && ($style = ImageStyle::load($style_id))) {
         if (!empty($dependencies[$style->getConfigDependencyKey()][$style->getConfigDependencyName()])) {
             $replacement_id = $this->imageStyleStorage->getReplacementId($style_id);
             // If a valid replacement has been provided in the storage, replace the
             // image style with the replacement and signal that the formatter plugin
             // settings were updated.
             if ($replacement_id && ImageStyle::load($replacement_id)) {
                 $this->setSetting('image_style', $replacement_id);
                 $changed = TRUE;
             }
         }
     }
     return $changed;
 }