Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResponsiveImageStyle.php

function ResponsiveImageStyle::getKeyedImageStyleMappings

Overrides ResponsiveImageStyleInterface::getKeyedImageStyleMappings

2 calls to ResponsiveImageStyle::getKeyedImageStyleMappings()
ResponsiveImageStyle::getImageStyleMapping in core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php
Gets the image style mapping for a breakpoint ID and multiplier.
ResponsiveImageStyle::hasImageStyleMappings in core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php
Checks if there is at least one mapping defined.

File

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

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;
}
RSS feed
Powered by Drupal