function sarnia_entity_server_name_load in Sarnia 7
Same name in this branch
- 7 sarnia.api.php \sarnia_entity_server_name_load()
- 7 sarnia.module \sarnia_entity_server_name_load()
Get a Sarnia entity type machine name given a Search API server machine name.
The fact that this function's name ends in '_load' is deceptive, since it doesn't actually load entity type information or an entity. However, it is used as a wildcard menu loader for Field UI administration paths.
This function works on the assumption that there will be a single Sarnia entity type for a particular Search API server.
Parameters
string $server_name: The machine name of a Search API server.
Return value
string The machine name of a Sarnia entity type, or FALSE if there is no Sarnia entity type associated with the given Search API server.
See also
6 calls to sarnia_entity_server_name_load()
- SarniaSolrService::postQuery in ./
service.inc - Stash the results as loaded entities.
- sarnia_entity_delete_form_submit in ./
sarnia.entities.inc - sarnia_entity_manage_form in ./
sarnia.entities.inc - This form appears on a "Sarnia" tab on Search API server configuration pages. It allows administrators to "enable sarnia" for a particular server; when Sarnia is enabled for a Search API server, a Sarnia entity type is…
- sarnia_field_ui_menu_load in ./
sarnia.module - Transform the server name argument into entity type and bundle arguments for field_ui_menu_load().
- sarnia_form_search_api_admin_confirm_alter in ./
sarnia.module - Implements hook_form_FORM_ID_alter().
File
- ./
sarnia.module, line 272
Code
function sarnia_entity_server_name_load($server_name) {
foreach (sarnia_entity_types() as $entity_type) {
if ($entity_type['search_api_server'] == $server_name) {
return $entity_type['machine_name'];
}
}
return FALSE;
}