You are here

function elasticsearch_connector_cluster_load in Elasticsearch Connector 7.5

Same name and namespace in other branches
  1. 7 elasticsearch_connector.module \elasticsearch_connector_cluster_load()
  2. 7.2 elasticsearch_connector.module \elasticsearch_connector_cluster_load()

Load a cluster object from the database.

Parameters

string $cluster_id:

Return value

object $cluster

See also

ctools_export_load_object().

2 calls to elasticsearch_connector_cluster_load()
elasticsearch_connector_get_client_by_id in ./elasticsearch_connector.module
Return the cluster object based on Cluster ID.
elasticsearch_watchdog_overview in modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc
Page callback: Displays a listing of log messages.
1 string reference to 'elasticsearch_connector_cluster_load'
elasticsearch_connector_edit_cluster in ./elasticsearch_connector.admin.inc
Add/edit Elasticsearch clusters.

File

./elasticsearch_connector.module, line 656
This module provide an interface to connecting to the elasticsearch cluster and implementing the official Elasticsearch library.

Code

function elasticsearch_connector_cluster_load($cluster_id) {
  ctools_include('export');
  $result = ctools_export_load_object('elasticsearch_connector_cluster', 'names', array(
    $cluster_id,
  ));
  drupal_alter('elasticsearch_connector_clusters', $result);
  if (isset($result[$cluster_id])) {
    if (isset($result[$cluster_id]->options) && !is_array($result[$cluster_id]->options)) {
      $result[$cluster_id]->options = unserialize($result[$cluster_id]->options);
    }
    return $result[$cluster_id];
  }
}