MailCacheBuild.php in Simplenews 3.x
Same filename and directory in other branches
Namespace
Drupal\simplenews\MailFile
src/Mail/MailCacheBuild.phpView source
<?php
namespace Drupal\simplenews\Mail;
/**
* Source cache implementation that caches build and data element.
*
* @ingroup mail
*/
class MailCacheBuild extends MailCacheStatic {
/**
* {@inheritdoc}
*/
public function isCacheable(MailInterface $mail, $group, $key) {
// Only cache for anon users.
if (\Drupal::currentUser()
->isAuthenticated()) {
return FALSE;
}
// Only cache data and build information.
return in_array($group, [
'data',
'build',
]);
}
}
Classes
Name | Description |
---|---|
MailCacheBuild | Source cache implementation that caches build and data element. |