You are here

class DateFieldItem in Date 8

Defines the 'text_item' and 'text_long_item' entity field items.

Hierarchy

  • class \Drupal\date_field\Type\DateFieldItem extends \Drupal\Core\Entity\Field\FieldItemBase

Expanded class hierarchy of DateFieldItem

File

date_field/lib/Drupal/date_field/Type/DateFieldItem.php, line 15
Definition of Drupal\date\Type\DateItem.

Namespace

Drupal\date_field\Type
View source
class DateFieldItem extends FieldItemBase {

  /**
   * Field definitions of the contained properties.
   *
   * @see self::getPropertyDefinitions()
   *
   * @var array
   */
  static $propertyDefinitions;

  /**
   * Implements ComplexDataInterface::getPropertyDefinitions().
   */
  public function getPropertyDefinitions() {
    if (!isset(self::$propertyDefinitions)) {
      self::$propertyDefinitions['value'] = array(
        'type' => 'date',
        'label' => t('Date value'),
      );
      self::$propertyDefinitions['value2'] = array(
        'type' => 'date',
        'label' => t('End Date value'),
      );
      self::$propertyDefinitions['data'] = array(
        'type' => 'string',
        'label' => t('A serialized array with more date info.'),
      );
    }
    return self::$propertyDefinitions;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DateFieldItem::$propertyDefinitions static property Field definitions of the contained properties.
DateFieldItem::getPropertyDefinitions public function Implements ComplexDataInterface::getPropertyDefinitions().