You are here

protected static function CalendarEvent::getDateFieldType 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::getDateFieldType()

Determines the date field type for the specified bundle.

Parameters

\Drupal\Core\Config\Entity\ConfigEntityInterface $type: The calendar event type entity.

Return value

string The date field type.

2 calls to CalendarEvent::getDateFieldType()
CalendarEvent::bundleFieldDefinitions in src/Entity/CalendarEvent.php
Provides field definitions for a specific bundle.
CalendarEvent::getDateFieldName in src/Entity/CalendarEvent.php
Determines the date field name for the specified bundle.

File

src/Entity/CalendarEvent.php, line 126

Class

CalendarEvent
Defines the "Calendar event" entity class.

Namespace

Drupal\opigno_calendar_event\Entity

Code

protected static function getDateFieldType(ConfigEntityInterface $type) {
  $date_field_type =& static::$date_field_types[$type
    ->id()];
  if (!isset($date_field_type)) {
    $date_field_type = $type
      ->get('date_field_type');
    if (!$date_field_type) {
      $date_field_type = 'timestamp';
      \Drupal::logger('opigno_calendar_event')
        ->critical('No date type defined for bundle "@bundle".', [
        '@bundle' => $type
          ->id(),
      ]);
    }
  }
  return $date_field_type;
}