You are here

abstract public function MailCacheStatic::isCacheable in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Mail/MailCacheStatic.php \Drupal\simplenews\Mail\MailCacheStatic::isCacheable()
  2. 8 src/Mail/MailCacheStatic.php \Drupal\simplenews\Mail\MailCacheStatic::isCacheable()

Return if the requested element should be cached.

Parameters

\Drupal\simplenews\Mail\MailInterface $mail: The mail object.

string $group: Group of the cache key, which allows cache implementations to decide what they want to cache. Currently used groups:

  • data: Raw data, e.g. attachments.
  • build: Built and themed content, before personalizations like tokens.
  • final: The final returned data. Caching this means that newsletter can not be personalized anymore.

string $key: Identifies the requested element, e.g. body or attachments.

Return value

bool TRUE if it should be cached, FALSE otherwise.

2 calls to MailCacheStatic::isCacheable()
MailCacheStatic::get in src/Mail/MailCacheStatic.php
Return a cached element, if existing.
MailCacheStatic::set in src/Mail/MailCacheStatic.php
Write an element to the cache.
2 methods override MailCacheStatic::isCacheable()
MailCacheBuild::isCacheable in src/Mail/MailCacheBuild.php
Return if the requested element should be cached.
MailCacheNone::isCacheable in src/Mail/MailCacheNone.php
Return if the requested element should be cached.

File

src/Mail/MailCacheStatic.php, line 78

Class

MailCacheStatic
Abstract implementation of the mail caching that does static caching.

Namespace

Drupal\simplenews\Mail

Code

public abstract function isCacheable(MailInterface $mail, $group, $key);