You are here

protected function IndexForm::getClusterField in Elasticsearch Connector 8.7

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

Gets cluster field.

Parameters

string $field: Field name.

Return value

array All clusters' fields.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to IndexForm::getClusterField()
IndexForm::buildEntityForm in src/Form/IndexForm.php
Builds entity form.

File

src/Form/IndexForm.php, line 139

Class

IndexForm
Form controller for node type forms.

Namespace

Drupal\elasticsearch_connector\Form

Code

protected function getClusterField($field) {
  $clusters = $this
    ->getAllClusters();
  $options = [];
  foreach ($clusters as $cluster) {
    $options[$cluster->{$field}] = $cluster->{$field};
  }
  return $options;
}