Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / src / Plugin / Field / FieldFormatter / EntityTestReferenceCustomCacheTagFormatter.php
1 <?php
2
3 namespace Drupal\entity_test\Plugin\Field\FieldFormatter;
4
5 use Drupal\Core\Field\FieldItemListInterface;
6 use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase;
7
8 /**
9  * Plugin implementation of the 'entity_reference_custom_cache_tag' formatter.
10  *
11  * @FieldFormatter(
12  *   id = "entity_reference_custom_cache_tag",
13  *   label = @Translation("Custom cache tag"),
14  *   field_types = {
15  *     "entity_reference"
16  *   }
17  * )
18  */
19 class EntityTestReferenceCustomCacheTagFormatter extends EntityReferenceFormatterBase {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function viewElements(FieldItemListInterface $items, $langcode) {
25     return ['#cache' => ['tags' => ['custom_cache_tag']]];
26   }
27
28 }