You are here

function _nodeblock_machine_name_exists in Nodeblock 7

Check if the machine name already exists.

1 string reference to '_nodeblock_machine_name_exists'
nodeblock_form_node_form_alter in ./nodeblock.module
Implements hook_form_node_form_alter().

File

./nodeblock.module, line 425
Enables use of specified node types as custom blocks.

Code

function _nodeblock_machine_name_exists($value) {
  $query = db_select('nodeblock', 'nb')
    ->condition('machine_name', $value);
  $query
    ->addExpression('count(*)', 'counts');
  return $query
    ->execute()
    ->fetchColumn() > 0;
}