You are here

protected function WidgetBase::prepareSelectedOptions in Select (or other) 4.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/WidgetBase.php \Drupal\select_or_other\Plugin\Field\FieldWidget\WidgetBase::prepareSelectedOptions()

Prepares selected options for comparison to the available options.

Sometimes widgets have to change the keys of their available options. This method allows those widgets to do the same with the selected options to ensure they actually end up selected in the widget.

Parameters

array $options: The options to prepare.

Return value

array The prepared option.

1 call to WidgetBase::prepareSelectedOptions()
WidgetBase::getSelectedOptions in src/Plugin/Field/FieldWidget/WidgetBase.php
Determines selected options from the incoming field values.
1 method overrides WidgetBase::prepareSelectedOptions()
ReferenceWidget::prepareSelectedOptions in src/Plugin/Field/FieldWidget/ReferenceWidget.php
Prepares selected options for comparison to the available options.

File

src/Plugin/Field/FieldWidget/WidgetBase.php, line 241

Class

WidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

protected function prepareSelectedOptions(array $options) {
  return $options;
}