function ResponsiveImageStyle::getKeyedImageStyleMappings

Same name and namespace in other branches
  1. 10 core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::getKeyedImageStyleMappings()
  2. 11.x core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::getKeyedImageStyleMappings()
  3. 9 core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::getKeyedImageStyleMappings()

File

core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php, line 147

Class

ResponsiveImageStyle
Defines the responsive image style entity.

Namespace

Drupal\responsive_image\Entity

Code

public function getKeyedImageStyleMappings() {
  if (!$this->keyedImageStyleMappings) {
    $this->keyedImageStyleMappings = [];
    foreach ($this->image_style_mappings as $mapping) {
      if (!static::isEmptyImageStyleMapping($mapping)) {
        $this->keyedImageStyleMappings[$mapping['breakpoint_id']][$mapping['multiplier']] = $mapping;
      }
    }
  }
  return $this->keyedImageStyleMappings;
}

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