You are here

function apachesolr_entity_get_callback in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_entity_get_callback()
  2. 7 apachesolr.module \apachesolr_entity_get_callback()

Returns the callback function appropriate for a given entity type/bundle.

@todo Backport work for the callbacks

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
Helper function for the hook_nodeapi().
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

... See full list

File

./apachesolr.module, line 2416
Integration with the Apache Solr search application.

Code

function apachesolr_entity_get_callback($entity_type, $callback, $bundle = NULL) {
  $info = content_types();
  $callback_function = NULL;

  // A bundle-specific callback takes precedence over the generic one for the
  // entity type.
  if ($bundle && isset($info[$bundle]['extra']['apachesolr'][$callback])) {
    $callback_function = $info[$bundle]['extra']['apachesolr'][$callback];
  }
  else {

    // In case the bundle was not specified we take a general assumption of node
    // indexation
    $callbacks = apachesolr_get_index_callbacks();
    $callback_function = $callbacks[$entity_type][$callback];
  }
  return $callback_function;
}