You are here

function redhen_fields_labels_in_use in RedHen CRM 7

Checks if a list of values are being used in actual field values.

1 call to redhen_fields_labels_in_use()
redhen_fields_allowed_labels_setting_validate in modules/redhen_fields/redhen_fields.module
Element validate callback; check that the entered values are valid.

File

modules/redhen_fields/redhen_fields.module, line 243
Defines email, phone and address field types for RedHen CRM.

Code

function redhen_fields_labels_in_use($field, $values) {
  if ($values) {
    $query = new EntityFieldQuery();
    $found = $query
      ->fieldCondition($field['field_name'], 'label_id', $values)
      ->range(0, 1)
      ->execute();
    return !empty($found);
  }
  return FALSE;
}