public static function CommentItem::propertyDefinitions in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php \Drupal\comment\Plugin\Field\FieldType\CommentItem::propertyDefinitions()
Defines field item properties.
Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().
Return value
\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.
Overrides FieldItemInterface::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- core/
modules/ comment/ src/ Plugin/ Field/ FieldType/ CommentItem.php, line 61 - Contains \Drupal\comment\Plugin\Field\FieldType\CommentItem.
Class
- CommentItem
- Plugin implementation of the 'comment' field type.
Namespace
Drupal\comment\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['status'] = DataDefinition::create('integer')
->setLabel(t('Comment status'))
->setRequired(TRUE);
$properties['cid'] = DataDefinition::create('integer')
->setLabel(t('Last comment ID'));
$properties['last_comment_timestamp'] = DataDefinition::create('integer')
->setLabel(t('Last comment timestamp'))
->setDescription(t('The time that the last comment was created.'));
$properties['last_comment_name'] = DataDefinition::create('string')
->setLabel(t('Last comment name'))
->setDescription(t('The name of the user posting the last comment.'));
$properties['last_comment_uid'] = DataDefinition::create('integer')
->setLabel(t('Last comment user ID'));
$properties['comment_count'] = DataDefinition::create('integer')
->setLabel(t('Number of comments'))
->setDescription(t('The number of comments.'));
return $properties;
}