You are here

function redhen_relation_role_name_exists in RedHen CRM 7

Returns whether a relation roles name already exists.

1 string reference to 'redhen_relation_role_name_exists'
redhen_relation_role_form in modules/redhen_relation/includes/redhen_relation_role.forms.inc
RedHen Relation Role form.

File

modules/redhen_relation/redhen_relation.module, line 813
Redhen CRM Relation Module.

Code

function redhen_relation_role_name_exists($name, $element, &$form_state) {
  $relation_role = entity_load('redhen_relation_role', array(
    $name,
  ));
  $relation_role = current($relation_role);
  if ($relation_role && $relation_role->redhen_relation_role_id != $form_state['redhen_relation_role']->redhen_relation_role_id) {
    return TRUE;
  }
}