Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConfigEntityBundleBase.php

function 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

protected function deleteDisplays() {
    // Remove entity displays of the deleted bundle.
    if ($displays = $this->loadDisplays('entity_view_display')) {
        $storage = $this->entityTypeManager()
            ->getStorage('entity_view_display');
        $storage->delete($displays);
    }
    // Remove entity form displays of the deleted bundle.
    if ($displays = $this->loadDisplays('entity_form_display')) {
        $storage = $this->entityTypeManager()
            ->getStorage('entity_form_display');
        $storage->delete($displays);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal