You are here

protected function Textimage::setCached in Textimage 8.3

Same name and namespace in other branches
  1. 8.4 src/Textimage.php \Drupal\textimage\Textimage::setCached()

Cache Textimage data.

Return value

$this

1 call to Textimage::setCached()
Textimage::process in src/Textimage.php
Process the Textimage, with the required raw text.

File

src/Textimage.php, line 884

Class

Textimage
Provides a Textimage.

Namespace

Drupal\textimage

Code

protected function setCached() {
  $data = [
    'imageData' => $this->imageData,
    'uri' => $this
      ->getUri(),
    'width' => $this
      ->getWidth(),
    'height' => $this
      ->getHeight(),
    'effects' => $this->effects,
    'bubbleableMetadata' => $this
      ->getBubbleableMetadata(),
  ];
  $this->cache
    ->set('tiid:' . $this->id, $data, Cache::PERMANENT, $this
    ->getBubbleableMetadata()
    ->getCacheTags());
  return $this;
}