function _cer_collect_fields_of_type in Corresponding Entity References 7.3
2 calls to _cer_collect_fields_of_type()
- cer_cer_fields in ./
cer.cer.inc - Implements hook_cer_fields().
- cer_commerce_cer_fields in extensions/
cer_commerce/ cer_commerce.cer.inc - Implements hook_cer_fields().
File
- ./
cer.cer.inc, line 52 - Contains CER hook implementations.
Code
function _cer_collect_fields_of_type($field_type, $class) {
$fields = array();
$result = db_query("SELECT fci.entity_type, fci.bundle, fci.field_name FROM {field_config_instance} fci INNER JOIN {field_config} fc ON fc.id = fci.field_id WHERE fc.type = :type AND fc.deleted = 0 AND fci.deleted = 0", array(
':type' => $field_type,
));
foreach ($result as $r) {
$fields["{$r->entity_type}:{$r->bundle}:{$r->field_name}"]['class'] = $class;
}
return $fields;
}