You are here

function services_ctools_export_ui_form_machine_name_exists in Services 7.3

Endpoint name check whether this machine name already exists.

1 string reference to 'services_ctools_export_ui_form_machine_name_exists'
services_ctools_export_ui_form in plugins/export_ui/services_ctools_export_ui.inc
Form to edit the settings of an endpoint.

File

plugins/export_ui/services_ctools_export_ui.inc, line 187

Code

function services_ctools_export_ui_form_machine_name_exists($value) {

  // Validate Name.
  //  $query = db_select('services_endpoint', 'e');
  //  $query->addField('e', 'eid');
  //  $query->condition('name', $value);
  $result = db_query('SELECT eid FROM {services_endpoint} WHERE name = :name', array(
    ':name' => $value,
  ))
    ->fetchField();
  return !empty($result);
}