You are here

function flexiform_entityreference_autocomplete_callback in Flexiform 7

Autocomplete callback for entityreference fields.

1 string reference to 'flexiform_entityreference_autocomplete_callback'
flexiform_menu in ./flexiform.module
Implements hook_menu()

File

./flexiform.entityreference.inc, line 10
Entityreference integration with flexiform.

Code

function flexiform_entityreference_autocomplete_callback($type, $flexiform, $element_namespace, $entity_id = '', $string = '') {
  $args = func_get_args();

  // Shift off the type, flexiform, element_namespace and entity_id.
  array_shift($args);
  array_shift($args);
  array_shift($args);
  array_shift($args);
  $string = implode('/', $args);
  $element = FlexiformElement::getElement($flexiform, $element_namespace);
  return entityreference_autocomplete_callback_get_matches($type, $element
    ->getField(), $element
    ->getInstance(), $element
    ->getEntityType(), $entity_id, $string);
}