You are here

public function DataTypePluginManager::getInstancesOptions in Search API 8

Returns all field data types known by the Search API as an options list.

Return value

string[] An associative array with all recognized types as keys, mapped to their translated display names.

See also

\Drupal\search_api\DataType\DataTypePluginManager::getInstances()

File

src/DataType/DataTypePluginManager.php, line 116

Class

DataTypePluginManager
Manages data type plugins.

Namespace

Drupal\search_api\DataType

Code

public function getInstancesOptions() {
  $types = [];
  foreach ($this
    ->getInstances() as $id => $info) {
    $types[$id] = $info
      ->label();
  }
  return $types;
}