You are here

class DateItem in Date 8

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

Hierarchy

  • class \Drupal\date\Type\DateItem extends \Drupal\Core\Entity\Field\FieldItemBase

Expanded class hierarchy of DateItem

File

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

Namespace

Drupal\date\Type
View source
class DateItem 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' => 'string',
        'label' => t('Date value'),
      );
      self::$propertyDefinitions['value2'] = array(
        'type' => 'string',
        'label' => t('End Date value'),
      );
      self::$propertyDefinitions['processed'] = array(
        'type' => 'string',
        'label' => t('Processed text'),
        'description' => t('The text value with the text format applied.'),
        'computed' => TRUE,
        'class' => '\\Drupal\\text\\TextProcessed',
        'settings' => array(
          'text source' => 'value',
        ),
      );
    }
    return self::$propertyDefinitions;
  }

}

Members

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