You are here

protected function CountryItem::getFieldDefinition in Country 8

Gets the field of the used field.$options['type'] = ['default' => 'select'].

Return value

\Drupal\Core\Field\FieldDefinitionInterface

1 call to CountryItem::getFieldDefinition()
CountryItem::getValueOptions in src/Plugin/views/filter/CountryItem.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

File

src/Plugin/views/filter/CountryItem.php, line 214

Class

CountryItem
Filter by country ISO2.

Namespace

Drupal\country\Plugin\views\filter

Code

protected function getFieldDefinition() {
  $definitions = $this->entityFieldManager
    ->getFieldDefinitions($this->definition['entity_type'], $this->options['country_target_bundle']);
  $definition = NULL;

  // @todo Unify 'entity field'/'field_name' instead of converting back and
  //   forth. https://www.drupal.org/node/2410779
  if (isset($this->definition['field_name'])) {
    $definition = $definitions[$this->definition['field_name']];
  }
  elseif (isset($this->definition['entity field'])) {
    $definition = $definitions[$this->definition['entity field']];
  }
  return $definition;
}