You are here

public static function PictureMapping::isEmptyMappingDefinition in Picture 7.2

Check if a mapping definition is empty.

Return value

bool TRUE if this mapping definition is considered empty, FALSE otherwise.

2 calls to PictureMapping::isEmptyMappingDefinition()
PictureMapping::hasMappings in includes/PictureMapping.php
Check if there are mappings.
picture_get_mapping_breakpoints in ./picture.module
Returns a list with the image styles of a mapping configuration.

File

includes/PictureMapping.php, line 235
Picture Mapping class.

Class

PictureMapping
Picture mapping class.

Code

public static function isEmptyMappingDefinition($mapping_definition) {
  if (!empty($mapping_definition) && isset($mapping_definition['mapping_type'])) {
    switch ($mapping_definition['mapping_type']) {
      case 'sizes':
        if ($mapping_definition['sizes'] && array_filter($mapping_definition['sizes_image_styles'])) {
          return FALSE;
        }
        break;
      case 'image_style':
        if ($mapping_definition['image_style']) {
          return FALSE;
        }
        break;
    }
  }
  return TRUE;
}