You are here

public function Field::getDataTypePlugin in Search API 8

Retrieves the Search API data type plugin for this field's type.

Return value

\Drupal\search_api\DataType\DataTypeInterface|null The data type plugin, or NULL if the type is unknown.

Overrides FieldInterface::getDataTypePlugin

1 call to Field::getDataTypePlugin()
Field::addValue in src/Item/Field.php
Adds a value to this field.

File

src/Item/Field.php, line 515

Class

Field
Represents a field on a search item that can be indexed.

Namespace

Drupal\search_api\Item

Code

public function getDataTypePlugin() {
  $data_type_manager = $this
    ->getDataTypeManager();
  if ($data_type_manager
    ->hasDefinition($this
    ->getType())) {
    return $data_type_manager
      ->createInstance($this
      ->getType());
  }
  return NULL;
}