public function ClusterManager::loadAllClusters in Elasticsearch Connector 8.7
Same name and namespace in other branches
- 8.5 src/ClusterManager.php \Drupal\elasticsearch_connector\ClusterManager::loadAllClusters()
- 8.6 src/ClusterManager.php \Drupal\elasticsearch_connector\ClusterManager::loadAllClusters()
Load all clusters.
Parameters
bool $include_inactive:
Return value
\Drupal\elasticsearch_connector\Entity\Cluster[]
File
- src/
ClusterManager.php, line 69
Class
- ClusterManager
- ClusterManager service.
Namespace
Drupal\elasticsearch_connectorCode
public function loadAllClusters($include_inactive = TRUE) {
$clusters = $this->entityTypeManager
->getStorage('elasticsearch_cluster')
->loadMultiple();
foreach ($clusters as $cluster) {
if (!$include_inactive && !$cluster->status) {
unset($clusters[$cluster->cluster_id]);
}
}
return $clusters;
}