You are here

protected function SelectOrOtherWidgetBase::prepareSelectedOptions in Select (or other) 8.3

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 SelectOrOtherWidgetBase::prepareSelectedOptions()
SelectOrOtherWidgetBase::getSelectedOptions in src/Plugin/Field/FieldWidget/SelectOrOtherWidgetBase.php
Determines selected options from the incoming field values.
1 method overrides SelectOrOtherWidgetBase::prepareSelectedOptions()
ReferenceWidget::prepareSelectedOptions in src/Plugin/Field/FieldWidget/EntityReference/ReferenceWidget.php
Prepares selected options for comparison to the available options.

File

src/Plugin/Field/FieldWidget/SelectOrOtherWidgetBase.php, line 293
Contains \Drupal\select_or_other\Plugin\Field\FieldWidget\SelectOrOtherWidgetBase.

Class

SelectOrOtherWidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

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