function ResponsiveImageStyleInterface::getImageStyleMapping

Same name in other branches
  1. 9 core/modules/responsive_image/src/ResponsiveImageStyleInterface.php \Drupal\responsive_image\ResponsiveImageStyleInterface::getImageStyleMapping()
  2. 8.9.x core/modules/responsive_image/src/ResponsiveImageStyleInterface.php \Drupal\responsive_image\ResponsiveImageStyleInterface::getImageStyleMapping()
  3. 11.x core/modules/responsive_image/src/ResponsiveImageStyleInterface.php \Drupal\responsive_image\ResponsiveImageStyleInterface::getImageStyleMapping()

Gets the image style mapping for a breakpoint ID and multiplier.

Parameters

string $breakpoint_id: The breakpoint ID.

string $multiplier: The multiplier.

Return value

array|null The image style mapping. NULL if the mapping does not exist. The image style mapping has following keys:

  • image_mapping_type: Either 'image_style' or 'sizes'.
  • image_mapping:
    • If image_mapping_type is 'image_style', the image style ID.
    • If image_mapping_type is 'sizes', an array with following keys:
      • sizes: The value for the 'sizes' attribute.
      • sizes_image_styles: The image styles to use for the 'srcset' attribute.
  • breakpoint_id: The breakpoint ID for this image style mapping.
  • multiplier: The multiplier for this image style mapping.
1 method overrides ResponsiveImageStyleInterface::getImageStyleMapping()
ResponsiveImageStyle::getImageStyleMapping in core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php
Gets the image style mapping for a breakpoint ID and multiplier.

File

core/modules/responsive_image/src/ResponsiveImageStyleInterface.php, line 118

Class

ResponsiveImageStyleInterface
Provides an interface defining a responsive_image mapping entity.

Namespace

Drupal\responsive_image

Code

public function getImageStyleMapping($breakpoint_id, $multiplier);

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