You are here

public function CoreViewsFacetSourceBase::getOriginalFieldName in Core Views Facets 8

Get original field name.

@todo Find a better solution.

Parameters

array $definition: Views handler defintion.

Return value

string Original field name.

2 calls to CoreViewsFacetSourceBase::getOriginalFieldName()
CoreViewsContextualFilter::getDataDefinition in src/Plugin/facets/facet_source/CoreViewsContextualFilter.php
CoreViewsExposedFilter::getDataDefinition in src/Plugin/facets/facet_source/CoreViewsExposedFilter.php

File

src/Plugin/facets/facet_source/CoreViewsFacetSourceBase.php, line 385

Class

CoreViewsFacetSourceBase
Provide common functions for core Views based facet sources.

Namespace

Drupal\core_views_facets\Plugin\facets\facet_source

Code

public function getOriginalFieldName(array $definition) {
  if (isset($definition['entity field'])) {
    return $definition['entity field'];
  }
  if (isset($definition['real_field'])) {
    return $definition['real_field'];
  }
  if (isset($definition['field_name'])) {
    return $definition['field_name'];
  }
  return $definition['field'] ?? '';
}