ConfigEntityBundleBase::deleteDisplays

protected ConfigEntityBundleBase::deleteDisplays()

Deletes display if a bundle is deleted.

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php, line 19

Class

ConfigEntityBundleBase
A base class for config entity types that act as bundles.

Namespace

Drupal\Core\Config\Entity

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
protected function deleteDisplays() {
  // Remove entity displays of the deleted bundle.
  if ($displays = $this->loadDisplays('entity_view_display')) {
    $storage = $this->entityManager()->getStorage('entity_view_display');
    $storage->delete($displays);
  }
 
  // Remove entity form displays of the deleted bundle.
  if ($displays = $this->loadDisplays('entity_form_display')) {
    $storage = $this->entityManager()->getStorage('entity_form_display');
    $storage->delete($displays);
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.