public function SearchApiDisplay::getDataDefinition in Facets 8
Returns a single field's data definition from the facet source.
Return value
\Drupal\Core\TypedData\DataDefinitionInterface A typed data definition.
Overrides FacetSourcePluginInterface::getDataDefinition
File
- src/
Plugin/ facets/ facet_source/ SearchApiDisplay.php, line 368
Class
- SearchApiDisplay
- Provides a facet source based on a Search API display.
Namespace
Drupal\facets\Plugin\facets\facet_sourceCode
public function getDataDefinition($field_name) {
$field = $this
->getIndex()
->getField($field_name);
if ($field) {
return $field
->getDataDefinition();
}
throw new Exception("Field with name {$field_name} does not have a definition");
}