7 list.module _list_values_in_use($field, $values)

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

2 calls to _list_values_in_use()
list_allowed_values_setting_validate in modules/field/modules/list/list.module
Element validate callback; check that the entered values are valid.
list_field_update_forbid in modules/field/modules/list/list.module
Implements hook_field_update_forbid().


modules/field/modules/list/list.module, line 371
Defines list field types that can be used with the Options module.


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

  return FALSE;