function apachesolr_entity_get_callback in Apache Solr Search 7
Same name and namespace in other branches
- 8 apachesolr.module \apachesolr_entity_get_callback()
- 6.3 apachesolr.module \apachesolr_entity_get_callback()
Returns the callback function appropriate for a given entity type/bundle.
Parameters
string $entity_type: The entity type for which we want to know the approprite callback.
string $callback: The callback for which we want the appropriate function.
string $bundle: If specified, the bundle of the entity in question. Some callbacks may be overridden on a bundle-level. Not specified only the entity-level callback will be checked.
Return value
string The function name for this callback, or NULL if not specified.
8 calls to apachesolr_entity_get_callback()
- apachesolr_convert_entity_to_documents in ./
apachesolr.index.inc - The given entity is converted to an array via the callback specified in the entity type's info array. The array that the entity is converted to is the model of the document sent to the Apache Solr server for indexing. This function allows…
- apachesolr_entity_update in ./
apachesolr.module - Implements hook_entity_update().
- apachesolr_index_config_form_submit in ./
apachesolr.admin.inc - Submit handler for the bundle configuration form.
- apachesolr_index_delete_index in ./
apachesolr.index.inc - Delete the whole index for an environment.
- apachesolr_index_get_entities_to_index in ./
apachesolr.index.inc - Returns an array of rows from a query based on an indexing environment. @todo Remove the read only because it is not environment specific
File
- ./
apachesolr.module, line 2470 - Integration with the Apache Solr search application.
Code
function apachesolr_entity_get_callback($entity_type, $callback, $bundle = NULL) {
$info = entity_get_info($entity_type);
// A bundle-specific callback takes precedence over the generic one for the
// entity type.
if ($bundle && isset($info['bundles'][$bundle]['apachesolr'][$callback])) {
$callback_function = $info['bundles'][$bundle]['apachesolr'][$callback];
}
elseif (isset($info['apachesolr'][$callback])) {
$callback_function = $info['apachesolr'][$callback];
}
else {
$callback_function = NULL;
}
return $callback_function;
}