You are here

function menu_position_machine_name_exists in Menu Position 7

Helper function to check if a given machine name already exists.

1 string reference to 'menu_position_machine_name_exists'
menu_position_rule_form in ./menu_position.admin.inc
Returns form to add or edit a menu position rule.

File

./menu_position.admin.inc, line 455
Provides infrequently used functions and hooks for menu_position.

Code

function menu_position_machine_name_exists($machine_name) {
  $result = db_select('menu_position_rules', 'menu_position_rules')
    ->fields('menu_position_rules')
    ->condition('machine_name', $machine_name)
    ->execute();
  $num_of_results = $result
    ->rowCount();
  return $num_of_results == 1 ? TRUE : FALSE;
}