You are here

public static function CalendarEvent::storageFieldDefinitions in Opigno calendar event 8

Same name and namespace in other branches
  1. 3.x src/Entity/CalendarEvent.php \Drupal\opigno_calendar_event\Entity\CalendarEvent::storageFieldDefinitions()

Provides storage field definitions for this entity type.

Parameters

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

Return value

\Drupal\Core\Field\FieldStorageDefinitionInterface[] An array of field storage definitions.

2 calls to CalendarEvent::storageFieldDefinitions()
opigno_calendar_event_entity_field_storage_info in ./opigno_calendar_event.module
Implements hook_entity_field_storage_info().
opigno_calendar_event_opigno_calendar_event_type_delete in ./opigno_calendar_event.module
Implements hook_ENTITY_TYPE_delete().

File

src/Entity/CalendarEvent.php, line 296

Class

CalendarEvent
Defines the "Calendar event" entity class.

Namespace

Drupal\opigno_calendar_event\Entity

Code

public static function storageFieldDefinitions(EntityTypeInterface $entity_type) {
  $storage_definitions = [];

  // Retrieve storage definitions for our date fields.
  $entity_type_id = $entity_type
    ->id();

  /** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
  $bundle_info = \Drupal::service('entity_type.bundle.info');
  foreach ($bundle_info
    ->getBundleInfo($entity_type_id) as $bundle => $info) {
    $storage_definitions += static::bundleFieldDefinitions($entity_type, $bundle, []);
  }
  return $storage_definitions;
}