function TextWithSummaryItem::propertyDefinitions

Same name in other branches
  1. 9 core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php \Drupal\text\Plugin\Field\FieldType\TextWithSummaryItem::propertyDefinitions()
  2. 10 core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php \Drupal\text\Plugin\Field\FieldType\TextWithSummaryItem::propertyDefinitions()
  3. 11.x core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php \Drupal\text\Plugin\Field\FieldType\TextWithSummaryItem::propertyDefinitions()

Overrides TextItemBase::propertyDefinitions

File

core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php, line 36

Class

TextWithSummaryItem
Plugin implementation of the 'text_with_summary' field type.

Namespace

Drupal\text\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    $properties = parent::propertyDefinitions($field_definition);
    $properties['summary'] = DataDefinition::create('string')->setLabel(t('Summary'));
    $properties['summary_processed'] = DataDefinition::create('string')->setLabel(t('Processed summary'))
        ->setDescription(t('The summary text with the text format applied.'))
        ->setComputed(TRUE)
        ->setClass('\\Drupal\\text\\TextProcessed')
        ->setSetting('text source', 'summary');
    return $properties;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.