You are here

public static function TaskLogItem::propertyDefinitions in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/gdpr_tasks/src/Plugin/Field/FieldType/TaskLogItem.php \Drupal\gdpr_tasks\Plugin\Field\FieldType\TaskLogItem::propertyDefinitions()
  2. 8 modules/gdpr_tasks/src/Plugin/Field/FieldType/TaskLogItem.php \Drupal\gdpr_tasks\Plugin\Field\FieldType\TaskLogItem::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

modules/gdpr_tasks/src/Plugin/Field/FieldType/TaskLogItem.php, line 26

Class

TaskLogItem
TaskLogItem field type.

Namespace

Drupal\gdpr_tasks\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
  $properties['entity_id'] = DataDefinition::create('integer')
    ->setLabel('Entity ID');
  $properties['entity_type'] = DataDefinition::create('string')
    ->setLabel('Entity Type');
  $properties['field_name'] = DataDefinition::create('string')
    ->setLabel('Field Name');
  $properties['action'] = DataDefinition::create('string')
    ->setLabel('Action');
  $properties['anonymizer'] = DataDefinition::create('string')
    ->setLabel('Anonymizer');
  return $properties;
}