You are here

protected function ImageStyleMappings::getMultiplierSettings in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/responsive_image/src/Plugin/migrate/process/ImageStyleMappings.php \Drupal\responsive_image\Plugin\migrate\process\ImageStyleMappings::getMultiplierSettings()

Extracts multiplier settings based on its type.

Parameters

array[] $multiplier_settings: The multiplier settings.

Return value

array The multiplier settings.

1 call to ImageStyleMappings::getMultiplierSettings()
ImageStyleMappings::transform in core/modules/responsive_image/src/Plugin/migrate/process/ImageStyleMappings.php
Performs the associated process.

File

core/modules/responsive_image/src/Plugin/migrate/process/ImageStyleMappings.php, line 60

Class

ImageStyleMappings
Transforms image style mappings.

Namespace

Drupal\responsive_image\Plugin\migrate\process

Code

protected function getMultiplierSettings(array $multiplier_settings) {
  $settings = [];
  if ($multiplier_settings['mapping_type'] == 'image_style') {
    $settings = $multiplier_settings['image_style'];
  }
  elseif ($multiplier_settings['mapping_type'] == 'sizes') {
    $settings = [
      'sizes' => $multiplier_settings['sizes'],
      'sizes_image_styles' => array_values($multiplier_settings['sizes_image_styles']),
    ];
  }
  return $settings;
}