deleteDisplays example

$this->entityTypeBundleInfo()->clearCachedBundles();
    }
  }

  /** * {@inheritdoc} */
  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage$entities);

    foreach ($entities as $entity) {
      $entity->deleteDisplays();
      \Drupal::service('entity_bundle.listener')->onBundleDelete($entity->id()$entity->getEntityType()->getBundleOf());
    }
  }

  /** * Acts on an entity before the presave hook is invoked. * * Used before the entity is saved and before invoking the presave hook. * * Ensure that config entities which are bundles of other entities cannot have * their ID changed. * * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The entity storage object. * * @throws \Drupal\Core\Config\ConfigNameException * Thrown when attempting to rename a bundle entity. */
Home | Imprint | This part of the site doesn't use cookies.