function ConfigTest::postDelete

Same name in other branches
  1. 9 core/modules/config/tests/config_test/src/Entity/ConfigTest.php \Drupal\config_test\Entity\ConfigTest::postDelete()
  2. 8.9.x core/modules/config/tests/config_test/src/Entity/ConfigTest.php \Drupal\config_test\Entity\ConfigTest::postDelete()
  3. 11.x core/modules/config/tests/config_test/src/Entity/ConfigTest.php \Drupal\config_test\Entity\ConfigTest::postDelete()

Overrides EntityBase::postDelete

File

core/modules/config/tests/config_test/src/Entity/ConfigTest.php, line 125

Class

ConfigTest
Defines the ConfigTest configuration entity.

Namespace

Drupal\config_test\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);
    foreach ($entities as $entity) {
        if ($entity->id() == 'dependency') {
            $dependent = $storage->load('dependent');
            $dependent->delete();
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.