You are here

public function DateRecurOccurrences::onEntityTypeDelete in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x src/DateRecurOccurrences.php \Drupal\date_recur\DateRecurOccurrences::onEntityTypeDelete()
  2. 3.0.x src/DateRecurOccurrences.php \Drupal\date_recur\DateRecurOccurrences::onEntityTypeDelete()
  3. 3.1.x src/DateRecurOccurrences.php \Drupal\date_recur\DateRecurOccurrences::onEntityTypeDelete()

Reacts to the deletion of the entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type being deleted.

Overrides EntityTypeEventSubscriberTrait::onEntityTypeDelete

File

src/DateRecurOccurrences.php, line 245

Class

DateRecurOccurrences
Manages occurrences tables and the data that populates them.

Namespace

Drupal\date_recur

Code

public function onEntityTypeDelete(EntityTypeInterface $entity_type) : void {
  if (!$entity_type instanceof ContentEntityTypeInterface) {

    // Only delete field for content entity types.
    return;
  }
  foreach ($this
    ->getBaseFieldStorages($entity_type) as $baseFieldStorage) {
    $this
      ->fieldStorageDelete($baseFieldStorage);
  }
}