You are here

protected function WidgetBase::getColumn in Select (or other) 8

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

Helper method to determine the identifying column for the field.

Return value

string The name of the column.

2 calls to WidgetBase::getColumn()
WidgetBase::formElement in src/Plugin/Field/FieldWidget/WidgetBase.php
Returns the form for a single field widget.
WidgetBase::getSelectedOptions in src/Plugin/Field/FieldWidget/WidgetBase.php
Determines selected options from the incoming field values.

File

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

Class

WidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

protected function getColumn() {
  static $property_names;
  if (empty($property_names)) {
    $property_names = $this->fieldDefinition
      ->getFieldStorageDefinition()
      ->getPropertyNames();
  }
  return reset($property_names);
}