/**
* The array of options for the widget.
*/
protected array
$options;
/**
* {@inheritdoc}
*/
public function __construct($plugin_id,
$plugin_definition, FieldDefinitionInterface
$field_definition, array
$settings, array
$third_party_settings) { parent::
__construct($plugin_id,
$plugin_definition,
$field_definition,
$settings,
$third_party_settings);
$property_names =
$this->fieldDefinition->
getFieldStorageDefinition()->
getPropertyNames();
$this->column =
$property_names[0
];
} /**
* {@inheritdoc}
*/
public function formElement(FieldItemListInterface
$items,
$delta, array
$element, array &
$form, FormStateInterface
$form_state) { // Prepare some properties for the child methods to build the actual form
// element.
$this->required =
$element['#required'
];
$this->multiple =
$this->fieldDefinition->
getFieldStorageDefinition()->
isMultiple();