function ImageStyleMappings::getMultiplierSettings

Same name in other branches
  1. 10 core/modules/responsive_image/src/Plugin/migrate/process/ImageStyleMappings.php \Drupal\responsive_image\Plugin\migrate\process\ImageStyleMappings::getMultiplierSettings()
  2. 11.x 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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.