TaskLogItemWidget.php in General Data Protection Regulation 8.2
File
modules/gdpr_tasks/src/Plugin/Field/FieldWidget/TaskLogItemWidget.php
View source
<?php
namespace Drupal\gdpr_tasks\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
class TaskLogItemWidget extends WidgetBase {
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
$element['entity_id'] = [
'#type' => 'number',
'#title' => 'Entity ID',
];
$element['entity_type'] = [
'#type' => 'textfield',
'#title' => 'Entity type',
];
$element['field_name'] = [
'#type' => 'textfield',
'#title' => 'Field Name',
];
$element['action'] = [
'#type' => 'textfield',
'#title' => 'Action',
];
$element['anonymizer'] = [
'#type' => 'textfield',
'#title' => 'Anonymizer',
];
return $element;
}
}