You are here

public static function Key::postDelete in Key 8

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

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

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

Overrides EntityBase::postDelete

File

src/Entity/Key.php, line 361

Class

Key
Defines the Key entity.

Namespace

Drupal\key\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
  foreach ($entities as $key) {

    /* @var $key \Drupal\key\Entity\Key */

    // Give the key provider plugin the opportunity to delete the key value.
    if ($key
      ->getKeyProvider() instanceof KeyProviderSettableValueInterface) {
      $key
        ->deleteKeyValue();
    }
  }
  parent::postDelete($storage, $entities);
}