You are here

public static function FeedsItem::propertyDefinitions in Feeds 8.3

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 EntityReferenceItem::propertyDefinitions

See also

\Drupal\Core\Field\BaseFieldDefinition

File

src/Plugin/Field/FieldType/FeedsItem.php, line 56

Class

FeedsItem
Plugin implementation of the 'feeds_item' field type.

Namespace

Drupal\feeds\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties = parent::propertyDefinitions($field_definition);
  $properties['imported'] = DataDefinition::create('timestamp')
    ->setLabel(t('Timestamp'));
  $properties['url'] = DataDefinition::create('uri')
    ->setLabel(t('Item URL'));
  $properties['guid'] = DataDefinition::create('string')
    ->setLabel(t('Item GUID'));
  $properties['hash'] = DataDefinition::create('string')
    ->setLabel(t('Item hash'));
  return $properties;
}