Drupal 8  8.0.2
ResponsiveImageStyle Class Reference
Inheritance diagram for ResponsiveImageStyle:

Public Member Functions

 __construct (array $values, $entity_type_id= 'responsive_image_style')
 
 addImageStyleMapping ($breakpoint_id, $multiplier, array $image_style_mapping)
 
 hasImageStyleMappings ()
 
 getKeyedImageStyleMappings ()
 
 getImageStyleMappings ()
 
 setBreakpointGroup ($breakpoint_group)
 
 getBreakpointGroup ()
 
 setFallbackImageStyle ($fallback_image_style)
 
 getFallbackImageStyle ()
 
 removeImageStyleMappings ()
 
 calculateDependencies ()
 
 getImageStyleMapping ($breakpoint_id, $multiplier)
 
 getImageStyleIds ()
 
- Public Member Functions inherited from ConfigEntityBase
 __construct (array $values, $entity_type)
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 isNew ()
 
 get ($property_name)
 
 set ($property_name, $value)
 
 enable ()
 
 disable ()
 
 setStatus ($status)
 
 status ()
 
 setSyncing ($syncing)
 
 isSyncing ()
 
 setUninstalling ($uninstalling)
 
 isUninstalling ()
 
 createDuplicate ()
 
 preSave (EntityStorageInterface $storage)
 
 calculateDependencies ()
 
 urlInfo ($rel= 'edit-form', array $options=[])
 
 url ($rel= 'edit-form', $options=array())
 
 link ($text=NULL, $rel= 'edit-form', array $options=[])
 
 toUrl ($rel= 'edit-form', array $options=[])
 
 getCacheTagsToInvalidate ()
 
 getDependencies ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
 onDependencyRemoval (array $dependencies)
 
 setThirdPartySetting ($module, $key, $value)
 
 getThirdPartySetting ($module, $key, $default=NULL)
 
 getThirdPartySettings ($module)
 
 unsetThirdPartySetting ($module, $key)
 
 getThirdPartyProviders ()
 
 isInstallable ()
 
 trustData ()
 
 hasTrustedData ()
 
 save ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 

Static Public Member Functions

static isEmptyImageStyleMapping (array $image_style_mapping)
 
- Static Public Member Functions inherited from ConfigEntityBase
static sort (ConfigEntityInterface $a, ConfigEntityInterface $b)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 

Protected Attributes

 $id
 
 $label
 
 $image_style_mappings = array()
 
 $keyedImageStyleMappings
 
 $breakpoint_group = ''
 
 $fallback_image_style = ''
 
- Protected Attributes inherited from ConfigEntityBase
 $originalId
 
 $pluginConfigKey
 
 $status = TRUE
 
 $uuid
 
 $langcode = 'en'
 
 $third_party_settings = array()
 
 $_core = []
 
 $trustedData = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Additional Inherited Members

- Protected Member Functions inherited from ConfigEntityBase
 getTypedConfig ()
 
 addDependency ($type, $name)
 
 invalidateTagsOnSave ($update)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 
- Static Protected Member Functions inherited from ConfigEntityBase
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
static getConfigManager ()
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 

Detailed Description

Defines the responsive image style entity.

( id = "responsive_image_style", label = ("Responsive image style"), handlers = { "list_builder" = "Drupal\responsive_image\ResponsiveImageStyleListBuilder", "form" = { "edit" = "Drupal\responsive_image\ResponsiveImageStyleForm", "add" = "Drupal\responsive_image\ResponsiveImageStyleForm", "delete" = "Drupal\Core\Entity\EntityDeleteForm", "duplicate" = "Drupal\responsive_image\ResponsiveImageStyleForm" } }, admin_permission = "administer responsive images", config_prefix = "styles", entity_keys = { "id" = "id", "label" = "label" }, links = { "edit-form" = "/admin/config/media/responsive-image-style/{responsive_image_style}", "duplicate-form" = "/admin/config/media/responsive-image-style/{responsive_image_style}/duplicate", "delete-form" = "/admin/config/media/responsive-image-style/{responsive_image_style}/delete", "collection" = "/admin/config/media/responsive-image-style", } )

Constructor & Destructor Documentation

__construct ( array  $values,
  $entity_type_id = 'responsive_image_style' 
)

{}

Member Function Documentation

addImageStyleMapping (   $breakpoint_id,
  $multiplier,
array  $image_style_mapping 
)

{Adds a image style mapping to the responsive image configuration entity.

Parameters
string$breakpoint_idThe breakpoint ID.
string$multiplierThe multiplier.
array$image_style_mappingThe mapping image style mapping.
Returns
$this
}

Implements ResponsiveImageStyleInterface.

calculateDependencies ( )

{Calculates dependencies and stores them in the dependency property.

Returns
$this
See Also
}

Implements ConfigEntityInterface.

References ConfigEntityBase\addDependency(), ResponsiveImageStyle\getImageStyleIds(), Entity\loadMultiple(), and Drupal\service().

Here is the call graph for this function:

getBreakpointGroup ( )

{Returns the breakpoint group for the responsive image style.

Returns
string The breakpoint group.
}

Implements ResponsiveImageStyleInterface.

getFallbackImageStyle ( )

{Returns the fallback image style ID for the responsive image style.

Returns
string The fallback image style ID.
}

Implements ResponsiveImageStyleInterface.

Referenced by ResponsiveImageStyle\getImageStyleIds().

Here is the caller graph for this function:

getImageStyleIds ( )

{Gets all the image styles IDs involved in the responsive image mapping.

Returns
string[]
}

Implements ResponsiveImageStyleInterface.

References ResponsiveImageStyle\getFallbackImageStyle(), and ResponsiveImageStyle\getImageStyleMappings().

Referenced by ResponsiveImageStyle\calculateDependencies().

Here is the call graph for this function:

Here is the caller graph for this function:

getImageStyleMapping (   $breakpoint_id,
  $multiplier 
)

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

Parameters
string$breakpoint_idThe breakpoint ID.
string$multiplierThe multiplier.
Returns
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.
}

Implements ResponsiveImageStyleInterface.

References ResponsiveImageStyle\getKeyedImageStyleMappings().

Here is the call graph for this function:

getImageStyleMappings ( )

{Returns the image style mappings for the responsive image style.

Returns
array[] An array of image style mappings. Each image style mapping array contains the following keys:
  • breakpoint_id
  • multiplier
  • image_mapping_type
  • image_mapping
}

Implements ResponsiveImageStyleInterface.

Referenced by ResponsiveImageStyle\getImageStyleIds().

Here is the caller graph for this function:

getKeyedImageStyleMappings ( )

{Returns the mappings of breakpoint ID and multiplier to image style.

Returns
array[] The image style mappings. Keyed by breakpoint ID then multiplier. The value is the image style mapping array with 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 mapping.
  • multiplier: The multiplier for this mapping.
}

Implements ResponsiveImageStyleInterface.

Referenced by ResponsiveImageStyle\getImageStyleMapping(), and ResponsiveImageStyle\hasImageStyleMappings().

Here is the caller graph for this function:

hasImageStyleMappings ( )

{Checks if there is at least one mapping defined.

Returns
bool Whether the entity has any image style mappings.
}

Implements ResponsiveImageStyleInterface.

References ResponsiveImageStyle\getKeyedImageStyleMappings().

Here is the call graph for this function:

static isEmptyImageStyleMapping ( array  $image_style_mapping)
static

{Checks if there is at least one image style mapping defined.

Parameters
array$image_style_mappingThe image style mapping.
Returns
bool Whether the image style mapping is empty.
}

Implements ResponsiveImageStyleInterface.

removeImageStyleMappings ( )

{Removes all image style mappings from the responsive image style.

Returns
$this
}

Implements ResponsiveImageStyleInterface.

Referenced by ResponsiveImageStyle\setBreakpointGroup().

Here is the caller graph for this function:

setBreakpointGroup (   $breakpoint_group)

{Sets the breakpoint group for the responsive image style.

Parameters
string$breakpoint_groupThe responsive image style breakpoint group.
Returns
$this
}

Implements ResponsiveImageStyleInterface.

References ResponsiveImageStyle\removeImageStyleMappings().

Here is the call graph for this function:

setFallbackImageStyle (   $fallback_image_style)

{Sets the fallback image style for the responsive image style.

Parameters
string$fallback_image_styleThe fallback image style ID.
Returns
$this
}

Implements ResponsiveImageStyleInterface.


The documentation for this class was generated from the following file: