You are here

function _phone_values_in_use in Phone 7.2

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

1 call to _phone_values_in_use()
phone_numbertype_allowed_values_setting_validate in ./phone.module
Element validate callback; check that the entered values are valid.

File

./phone.module, line 393
The phone module lets administrators use a phone number field type.

Code

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