You are here

public static function SmartDateRule::postDelete in Smart Date 3.3.x

Same name and namespace in other branches
  1. 8.2 modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::postDelete()
  2. 3.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::postDelete()
  3. 3.0.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::postDelete()
  4. 3.1.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::postDelete()
  5. 3.2.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::postDelete()
  6. 3.4.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::postDelete()

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

modules/smart_date_recur/src/Entity/SmartDateRule.php, line 757

Class

SmartDateRule
Defines the Smart date rule entity.

Namespace

Drupal\smart_date_recur\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
  parent::postDelete($storage, $entities);
  foreach ($entities as $id => $rrule) {

    // Delete any child overrides when a rule is deleted.
    $overrides = $rrule
      ->getRuleOverrides();
    foreach ($overrides as $override) {
      $override
        ->delete();
    }
  }
}