function command_buttons_machine_name_exists in Command Buttons 7
Callback to determine if an entities machine name already exists.
2 calls to command_buttons_machine_name_exists()
- command_buttons_create_node_button in ./
command_buttons.module - Create a node add button based on the node type and label.
- command_buttons_node_type_delete in ./
command_buttons.module - Implements hook_node_type_delete().
1 string reference to 'command_buttons_machine_name_exists'
- command_buttons_entity_edit_form in ./
command_buttons.module - Basic edit form for the button entity.
File
- ./
command_buttons.module, line 849
Code
function command_buttons_machine_name_exists($value) {
$name_exists = db_select('command_buttons', 'b')
->fields('b', array(
'name',
))
->condition('b.name', $value)
->execute()
->fetchField();
return !empty($name_exists);
}