You are here

public function BlazyManager::getResponsiveImageCacheTags in Blazy 8

Returns the Responsive image cache tags.

Parameters

object $responsive: The responsive image style entity.

Return value

array The responsive image cache tags, or empty array.

1 call to BlazyManager::getResponsiveImageCacheTags()
BlazyManager::preRenderImage in src/BlazyManager.php
Builds the Blazy image as a structured array ready for ::renderer().

File

src/BlazyManager.php, line 377

Class

BlazyManager
Implements a public facing blazy manager.

Namespace

Drupal\blazy

Code

public function getResponsiveImageCacheTags($responsive = NULL) {
  $cache_tags = [];
  $image_styles_to_load = [];
  if ($responsive) {
    $cache_tags = Cache::mergeTags($cache_tags, $responsive
      ->getCacheTags());
    $image_styles_to_load = $responsive
      ->getImageStyleIds();
  }
  $image_styles = $this
    ->entityLoadMultiple('image_style', $image_styles_to_load);
  foreach ($image_styles as $image_style) {
    $cache_tags = Cache::mergeTags($cache_tags, $image_style
      ->getCacheTags());
  }
  return $cache_tags;
}