You are here

function relation_ui_endpoints_type_autocomplete in Relation 7

Autocomplete function for endpoint type filter.

1 string reference to 'relation_ui_endpoints_type_autocomplete'
relation_ui_menu in ./relation_ui.module
Implements hook_menu().

File

./relation_ui.module, line 838
Provide administration interface for relation type bundles.

Code

function relation_ui_endpoints_type_autocomplete($string = '') {
  $result = db_query("SELECT distinct endpoints_entity_type FROM {field_data_endpoints} WHERE endpoints_entity_type LIKE :string", array(
    ":string" => db_like($string) . '%',
  ));
  $matches = array();
  while ($res = $result
    ->fetchObject()) {
    $matches[$res->endpoints_entity_type] = $res->endpoints_entity_type;
  }
  drupal_json_output($matches);
}