function ResponsiveImageStyle::isEmptyImageStyleMapping
Same name in other branches
- 9 core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::isEmptyImageStyleMapping()
- 8.9.x core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::isEmptyImageStyleMapping()
- 11.x core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::isEmptyImageStyleMapping()
Overrides ResponsiveImageStyleInterface::isEmptyImageStyleMapping
1 call to ResponsiveImageStyle::isEmptyImageStyleMapping()
- ResponsiveImageStyle::getKeyedImageStyleMappings in core/
modules/ responsive_image/ src/ Entity/ ResponsiveImageStyle.php - Returns the mappings of breakpoint ID and multiplier to image style.
File
-
core/
modules/ responsive_image/ src/ Entity/ ResponsiveImageStyle.php, line 259
Class
- ResponsiveImageStyle
- Defines the responsive image style entity.
Namespace
Drupal\responsive_image\EntityCode
public static function isEmptyImageStyleMapping(array $image_style_mapping) {
if (!empty($image_style_mapping)) {
switch ($image_style_mapping['image_mapping_type']) {
case 'sizes':
// The image style mapping must have a sizes attribute defined and one
// or more image styles selected.
if ($image_style_mapping['image_mapping']['sizes'] && $image_style_mapping['image_mapping']['sizes_image_styles']) {
return FALSE;
}
break;
case 'image_style':
// The image style mapping must have an image style selected.
if ($image_style_mapping['image_mapping']) {
return FALSE;
}
break;
}
}
return TRUE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.