class TextItem

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

Hierarchy

Expanded class hierarchy of TextItem

File

drupal/core/modules/field/modules/text/lib/Drupal/text/Type/TextItem.php, line 15
Definition of Drupal\text\Type\TextItem.

Namespace

Drupal\text\Type
View source
class TextItem 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('Text value'),
      );
      self::$propertyDefinitions['format'] = array(
        'type' => 'string',
        'label' => t('Text format'),
      );
      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
FieldItemBase::$name protected property The item delta or name.
FieldItemBase::$parent protected property The parent entity field.
FieldItemBase::$properties protected property The array of properties.
FieldItemBase::get public function Implements ComplexDataInterface::get(). Overrides ComplexDataInterface::get
FieldItemBase::getIterator public function Implements IteratorAggregate::getIterator().
FieldItemBase::getName public function Implements ContextAwareInterface::getName(). Overrides ContextAwareInterface::getName
FieldItemBase::getParent public function Implements ContextAwareInterface::getParent(). Overrides ContextAwareInterface::getParent
FieldItemBase::getProperties public function Implements ComplexDataInterface::getProperties(). Overrides ComplexDataInterface::getProperties
FieldItemBase::getPropertyDefinition public function Implements ComplexDataInterface::getPropertyDefinition(). Overrides ComplexDataInterface::getPropertyDefinition
FieldItemBase::getPropertyValues public function Implements ComplexDataInterface::getPropertyValues(). Overrides ComplexDataInterface::getPropertyValues
FieldItemBase::getString public function Implements TypedDataInterface::getString(). Overrides TypedData::getString
FieldItemBase::getValue public function Implements TypedDataInterface::getValue(). Overrides TypedData::getValue
FieldItemBase::isEmpty public function Implements ComplexDataInterface::isEmpty(). Overrides ComplexDataInterface::isEmpty
FieldItemBase::set public function Implements ComplexDataInterface::set(). Overrides ComplexDataInterface::set
FieldItemBase::setName public function Implements ContextAwareInterface::setName(). Overrides ContextAwareInterface::setName
FieldItemBase::setParent public function Implements ContextAwareInterface::setParent(). Overrides ContextAwareInterface::setParent
FieldItemBase::setPropertyValues public function Implements ComplexDataInterface::setPropertyValues(). Overrides ComplexDataInterface::setPropertyValues
FieldItemBase::setValue public function Implements TypedDataInterface::setValue(). Overrides TypedData::setValue 3
FieldItemBase::validate public function Implements TypedDataInterface::validate(). Overrides TypedDataInterface::validate
FieldItemBase::__clone public function Implements a deep clone.
FieldItemBase::__construct public function Implements TypedDataInterface::__construct(). Overrides TypedData::__construct
FieldItemBase::__get public function Implements FieldItemInterface::__get(). Overrides FieldItemInterface::__get
FieldItemBase::__isset public function Implements FieldItemInterface::__isset(). Overrides FieldItemInterface::__isset
FieldItemBase::__set public function Implements FieldItemInterface::__set(). Overrides FieldItemInterface::__set
FieldItemBase::__unset public function Implements FieldItemInterface::__unset(). Overrides FieldItemInterface::__unset
TextItem::$propertyDefinitions static property Field definitions of the contained properties. 1
TextItem::getPropertyDefinitions public function Implements ComplexDataInterface::getPropertyDefinitions(). Overrides ComplexDataInterface::getPropertyDefinitions 1
TypedData::$definition protected property The data definition.
TypedData::getDefinition public function Implements TypedDataInterface::getDefinition(). Overrides TypedDataInterface::getDefinition
TypedData::getType public function Implements TypedDataInterface::getType(). Overrides TypedDataInterface::getType