You are here

public function ImageStyleConfigurationHandler::onFieldInstanceLoad in Configuration Management 7.3

File

src/Handlers/ImageStyleConfigurationHandler.php, line 150

Class

ImageStyleConfigurationHandler

Namespace

Configuration\Handlers

Code

public function onFieldInstanceLoad($event) {

  // Check if the field is using a image style
  $field = $event->configuration
    ->getData();
  if (!empty($field['display'])) {
    foreach ($field['display'] as $display) {
      if (!empty($display['settings']['image_style'])) {
        $identifier = $display['settings']['image_style'];
        $this->configuration_manager
          ->newDependency($event->configuration, 'image_style.' . $identifier);
      }
    }
  }
}