You are here

function _field_tools_field_already_attached in Field tools 7

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.

1 call to _field_tools_field_already_attached()
_field_tools_add_instance_to_bundles in ./field_tools.admin.inc
Helper function to clone a single field instance into multiple bundles.

File

./field_tools.module, line 300
field_tools.module Contains useful tools for working with fields.

Code

function _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]);
}