You are here

public function DateRecurOccurrences::onEntityTypeCreate in Recurring Dates Field 3.x

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

Reacts to the creation of the entity type.

Parameters

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

Overrides EntityTypeEventSubscriberTrait::onEntityTypeCreate

File

src/DateRecurOccurrences.php, line 231

Class

DateRecurOccurrences
Manages occurrences tables and the data that populates them.

Namespace

Drupal\date_recur

Code

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

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