public function ProcessEntities::entitySetCacheTags in Field Encryption 3.0.x
Sets an entity's encrypted field's cache tags appropriately.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity being viewed.
array $build: A renderable array representing the entity content.
See also
File
- src/
ProcessEntities.php, line 332
Class
- ProcessEntities
- Service class to process entities and fields for encryption.
Namespace
Drupal\field_encryptCode
public function entitySetCacheTags(ContentEntityInterface $entity, array &$build) {
foreach ($this
->getEncryptedFields($entity) as $field) {
$build[$field
->getName()]['#cache']['max-age'] = 0;
}
}