You are here

protected function MailCacheStatic::getCid in Simplenews 8

Same name and namespace in other branches
  1. 8.2 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

File

src/Mail/MailCacheStatic.php, line 28

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
    ->getEntity()
    ->id();
  return $mail
    ->getEntity()
    ->getEntityTypeId() . ':' . $entity_id . ':' . $mail
    ->getLanguage();
}