You are here

protected function MailCacheStatic::getCid in Simplenews 8.2

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

Returns the cache identifier for the mail.

Parameters

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

Return value

string Cache identifier.

File

src/Mail/MailCacheStatic.php, line 31

Class

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

Namespace

Drupal\simplenews\Mail

Code

protected function getCid(MailInterface $mail) {
  $entity_id = $mail
    ->getIssue()
    ->id();
  return $mail
    ->getIssue()
    ->getEntityTypeId() . ':' . $entity_id . ':' . $mail
    ->getLanguage();
}