You are here

public function Tag::postSave in Doubleclick for Publishers (DFP) 8

Acts on a saved entity before the insert or update hook is invoked.

Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters

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

bool $update: TRUE if the entity has been updated, or FALSE if it has been inserted.

Overrides EntityBase::postSave

File

src/Entity/Tag.php, line 238
Contains \Drupal\dfp\Entity\Tag.

Class

Tag
Defines the DFP Ad tag configuration entity class.

Namespace

Drupal\dfp\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
  parent::postSave($storage, $update);

  // Invalidate the block cache to update DFP ad tag-based derivatives.
  \Drupal::service('plugin.manager.block')
    ->clearCachedDefinitions();
}