function elasticsearch_watchdog_elasticsearch_connector_edit_lock in Elasticsearch Connector 7.2
Same name and namespace in other branches
- 7.5 modules/elasticsearch_watchdog/elasticsearch_watchdog.module \elasticsearch_watchdog_elasticsearch_connector_edit_lock()
- 7 modules/elasticsearch_watchdog/elasticsearch_watchdog.module \elasticsearch_watchdog_elasticsearch_connector_edit_lock()
Implemens hook_elasticsearch_connector_edit_lock().
File
- modules/
elasticsearch_watchdog/ elasticsearch_watchdog.module, line 286 - Created on Jan 06, 2014
Code
function elasticsearch_watchdog_elasticsearch_connector_edit_lock($type, $cluster, $index = NULL) {
$client_id = elasticsearch_watchdog_get_cluster_id();
if (!empty($client_id) && $client_id == $cluster->cluster_id) {
if ($type == 'cluster') {
return TRUE;
}
elseif ($type == 'index') {
$index_name = elasticsearch_watchdog_get_realindex_name();
if ($index == $index_name) {
return TRUE;
}
}
}
return FALSE;
}