You are here

public function LocationInputPluginManager::getInstances in Search API Location 8

Returns all known location input methods.

Return value

\Drupal\search_api_location\LocationInput\LocationInputInterface[] An array of data type plugins, keyed by type identifier.

File

src/LocationInput/LocationInputPluginManager.php, line 37

Class

LocationInputPluginManager
Defines a plugin manager for Location Inputs.

Namespace

Drupal\search_api_location\LocationInput

Code

public function getInstances() {
  if (!isset($this->locationInputMethods)) {
    $this->locationInputMethods = [];
    foreach ($this
      ->getDefinitions() as $name => $data_type_definition) {
      if (class_exists($data_type_definition['class']) && empty($this->locationInputMethods[$name])) {
        $data_type = $this
          ->createInstance($name);
        $this->locationInputMethods[$name] = $data_type;
      }
    }
  }
  return $this->locationInputMethods;
}