function node_field_machine_name_check in Node Field 7.2
Callback function for machine_name field.
2 string references to 'node_field_machine_name_check'
- node_field_node_field_edit_form in includes/
node_field.form.node_field.inc - Settings form for single node field.
- _node_field_node_field_page_new_field_form in includes/
node_field.form.node_field.inc - Form element for new node field.
File
- includes/
node_field.form.node_field.inc, line 334 - Node fields forms.
Code
function node_field_machine_name_check($value) {
$nid = arg(1);
// TODO: Move to node_field.db.inc.
$name_exists = db_query_range("SELECT 1 FROM {node_field} WHERE machine_name = :name AND nid = :nid", 0, 1, [
':name' => $value,
':nid' => $nid,
])
->fetchField();
return $name_exists;
}