function D7_field_tools_field_already_attached in Field tools 8
Helper function to tell if a field is already attached to a bundle.
Parameters
string $entity_type: The entity type to check.
string $bundle_type: The bundle type to check.
array $field_info: The field info array for the field to check.
Return value
boolean Whether the field is already attached to this bundle.
File
- ./
field_tools.module, line 334 - field_tools.module Contains useful tools for working with fields.
Code
function D7_field_tools_field_already_attached($entity_type, $bundle_type, $field_info) {
return array_key_exists($entity_type, $field_info['bundles']) && in_array($bundle_type, $field_info['bundles'][$entity_type]);
}