public function RngEntityModel::hook_entity_predelete in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/RngEntityModel.php \Drupal\rng\RngEntityModel::hook_entity_predelete()
- 3.x src/RngEntityModel.php \Drupal\rng\RngEntityModel::hook_entity_predelete()
React to Drupal `hook_entity_predelete` hook.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity object for the entity that is about to be deleted.
See also
File
- src/
RngEntityModel.php, line 126
Class
- RngEntityModel
- Enforces RNG model relationships.
Namespace
Drupal\rngCode
public function hook_entity_predelete(EntityInterface $entity) {
if (in_array($entity
->getEntityType(), $this->identityChannelManager
->getIdentityTypes())) {
$this
->deletePerson($entity);
}
if ($this->eventManager
->isEvent($entity)) {
$this
->deleteRngEvent($entity);
}
if ($entity instanceof RuleComponentInterface) {
$this
->deleteRngRuleComponent($entity);
}
}