function og_entityreference_autocomplete_callback in Organic groups 7.2
Menu callback: autocomplete the label of an entity.
Parameters
$type: The widget type (i.e. 'single' or 'tags').
$field_name: The name of the entity-reference field.
$entity_type: The entity type.
$bundle_name: The bundle name.
$field_mode: The field mode, "default" or "admin".
$entity_id: Optional; The entity ID the entity-reference field is attached to. Defaults to ''.
$string: The label of the entity to query by.
See also
entityreference_autocomplete_callback()
1 string reference to 'og_entityreference_autocomplete_callback'
File
- includes/
og.field.inc, line 382 - Field widget related code for Organic groups.
Code
function og_entityreference_autocomplete_callback($type, $field_name, $entity_type, $bundle_name, $field_mode, $entity_id = '', $string = '') {
$field = field_info_field($field_name);
$instance = field_info_instance($entity_type, $field_name, $bundle_name);
$instance = og_get_mocked_instance($instance, $field_mode);
if (!$field || !$instance || $field['type'] != 'entityreference' || !field_access('edit', $field, $entity_type)) {
return MENU_ACCESS_DENIED;
}
return entityreference_autocomplete_callback_get_matches($type, $field, $instance, $entity_type, $entity_id, $string);
}