class ImageNormalizerValue in Consumer Image Styles 8.2
Same name and namespace in other branches
- 8 src/Normalizer/Value/ImageNormalizerValue.php \Drupal\consumer_image_styles\Normalizer\Value\ImageNormalizerValue
Hierarchy
- class \Drupal\consumer_image_styles\Normalizer\Value\ImageNormalizerValue implements RefinableCacheableDependencyInterface, ValueExtractorInterface uses RefinableCacheableDependencyTrait
Expanded class hierarchy of ImageNormalizerValue
1 file declares its use of ImageNormalizerValue
- ImageEntityNormalizer.php in src/
Normalizer/ ImageEntityNormalizer.php
File
- src/
Normalizer/ Value/ ImageNormalizerValue.php, line 10
Namespace
Drupal\consumer_image_styles\Normalizer\ValueView source
class ImageNormalizerValue implements ValueExtractorInterface, RefinableCacheableDependencyInterface {
use RefinableCacheableDependencyTrait;
/**
* @var \Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue
*/
protected $subject;
/**
* The values.
*
* @param array
*/
protected $variants;
/**
* ImageNormalizerValue constructor.
*/
public function __construct($variants, EntityNormalizerValue $subject) {
$this->subject = $subject;
$this->variants = $variants;
$this
->addCacheableDependency($variants);
}
/**
* {@inheritdoc}
*/
public function rasterizeValue() {
$rasterized = $this->subject
->rasterizeValue();
$derivatives = $this->variants
->rasterizeValue();
if (empty($derivatives)) {
return $rasterized;
}
$rasterized['meta'] = empty($rasterized['meta']) ? [] : $rasterized['meta'];
$rasterized['meta']['derivatives'] = $derivatives;
return $rasterized;
}
/**
* {@inheritdoc}
*/
public function rasterizeIncludes() {
return $this->subject
->rasterizeIncludes();
}
/**
* Gets the values.
*
* @return mixed
* The values.
*/
public function getValues() {
return $this->subject
->getValues();
}
/**
* Gets a flattened list of includes in all the chain.
*
* @return \Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue[]
* The array of included relationships.
*/
public function getIncludes() {
return $this->subject
->getIncludes();
}
}