public static function ConfigPagesType::postDelete in Config Pages 8
Same name and namespace in other branches
- 8.3 src/Entity/ConfigPagesType.php \Drupal\config_pages\Entity\ConfigPagesType::postDelete()
- 8.2 src/Entity/ConfigPagesType.php \Drupal\config_pages\Entity\ConfigPagesType::postDelete()
Provides the list of config_pages types.
Parameters
\Drupal\Core\Entity\EntityStorageInterface $storage: Storage interface.
array: Array of entities.
Overrides ConfigEntityBundleBase::postDelete
File
- src/
Entity/ ConfigPagesType.php, line 72
Class
- ConfigPagesType
- Defines the config page type entity.
Namespace
Drupal\config_pages\EntityCode
public static function postDelete(EntityStorageInterface $storage, array $entities) {
$query = \Drupal::entityQuery('config_pages');
$type = array_shift($entities);
$label = $type
->label();
$config_page_ids = $query
->condition('label', $label)
->execute();
$cp_storage = \Drupal::service('entity_type.manager')
->getStorage('config_pages');
$cp_entities = $cp_storage
->loadMultiple($config_page_ids);
$cp_storage
->delete($cp_entities);
}