protected function RngEntityModel::deleteRngRuleComponent in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/RngEntityModel.php \Drupal\rng\RngEntityModel::deleteRngRuleComponent()
- 3.x src/RngEntityModel.php \Drupal\rng\RngEntityModel::deleteRngRuleComponent()
Delete related entities when a rule component entity is deleted.
Parameters
\Drupal\rng\RuleComponentInterface $entity: An RNG rule component entity.
1 call to RngEntityModel::deleteRngRuleComponent()
- RngEntityModel::hook_entity_predelete in src/
RngEntityModel.php - React to Drupal `hook_entity_predelete` hook.
File
- src/
RngEntityModel.php, line 218
Class
- RngEntityModel
- Enforces RNG model relationships.
Namespace
Drupal\rngCode
protected function deleteRngRuleComponent(RuleComponentInterface $entity) {
// Delete a TemplateCollection if the entity is a component with
// configuration for 'rng_courier_message'.
if ('rng_courier_message' == $entity
->getPluginId()) {
$action = $entity
->createInstance();
if ($action instanceof CourierTemplateCollection) {
$template_collection = $action
->getTemplateCollection();
if ($template_collection) {
$template_collection
->delete();
}
}
}
}