depcalc.module in Dependency Calculation 8
File
depcalc.moduleView source
<?php
use Drupal\Core\Cache\Cache;
use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_entity_presave().
*/
function depcalc_entity_presave(EntityInterface $entity) {
if ($uuid = $entity
->uuid()) {
$backend = \Drupal::cache('depcalc');
$backend
->invalidate($uuid);
Cache::invalidateTags([
$uuid,
]);
}
}
/**
* Implements hook_entity_delete().
*/
function depcalc_entity_delete(EntityInterface $entity) {
if ($uuid = $entity
->uuid()) {
$backend = \Drupal::cache('depcalc');
$backend
->delete($uuid);
Cache::invalidateTags([
$uuid,
]);
}
}
Functions
Name | Description |
---|---|
depcalc_entity_delete | Implements hook_entity_delete(). |
depcalc_entity_presave | Implements hook_entity_presave(). |