You are here

protected function IndexForm::getAllClusters in Elasticsearch Connector 8.7

Same name and namespace in other branches
  1. 8 src/Form/IndexForm.php \Drupal\elasticsearch_connector\Form\IndexForm::getAllClusters()
  2. 8.2 src/Form/IndexForm.php \Drupal\elasticsearch_connector\Form\IndexForm::getAllClusters()
  3. 8.5 src/Form/IndexForm.php \Drupal\elasticsearch_connector\Form\IndexForm::getAllClusters()
  4. 8.6 src/Form/IndexForm.php \Drupal\elasticsearch_connector\Form\IndexForm::getAllClusters()

Gets all clusters.

Return value

array All clusters

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

2 calls to IndexForm::getAllClusters()
IndexForm::getClusterField in src/Form/IndexForm.php
Gets cluster field.
IndexForm::getSelectedClusterUrl in src/Form/IndexForm.php
Returns url of the selected cluster.

File

src/Form/IndexForm.php, line 116

Class

IndexForm
Form controller for node type forms.

Namespace

Drupal\elasticsearch_connector\Form

Code

protected function getAllClusters() {
  $options = [];
  foreach ($this
    ->getClusterStorage()
    ->loadMultiple() as $cluster_machine_name) {
    $options[$cluster_machine_name->cluster_id] = $cluster_machine_name;
  }
  return $options;
}