You are here

public static function Synonym::postLoad in Synonyms 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/Synonym.php \Drupal\synonyms\Entity\Synonym::postLoad()

Acts on loaded entities.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides EntityBase::postLoad

File

src/Entity/Synonym.php, line 139

Class

Synonym
Synonym configuration entity.

Namespace

Drupal\synonyms\Entity

Code

public static function postLoad(EntityStorageInterface $storage, array &$entities) {
  parent::postLoad($storage, $entities);
  foreach ($entities as $entity) {
    $entity
      ->addCacheTags([
      self::cacheTagConstruct($entity
        ->getProviderPluginInstance()
        ->getPluginDefinition()['controlled_entity_type'], $entity
        ->getProviderPluginInstance()
        ->getPluginDefinition()['controlled_bundle']),
    ]);
  }
}