You are here

protected function IndexForm::getSelectedClusterUrl in Elasticsearch Connector 8.7

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

Returns url of the selected cluster.

Parameters

string $id: Cluster id.

Return value

string Cluster url.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Form/IndexForm.php, line 160

Class

IndexForm
Form controller for node type forms.

Namespace

Drupal\elasticsearch_connector\Form

Code

protected function getSelectedClusterUrl($id) {
  $result = NULL;
  $clusters = $this
    ->getAllClusters();
  foreach ($clusters as $cluster) {
    if ($cluster->cluster_id == $id) {
      $result = $cluster->url;
    }
  }
  return $result;
}