summaryrefslogtreecommitdiff
path: root/modules/field/field.info.inc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/field/field.info.inc')
-rw-r--r--modules/field/field.info.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc
index 53d5a2049..d2d22bfe0 100644
--- a/modules/field/field.info.inc
+++ b/modules/field/field.info.inc
@@ -576,6 +576,25 @@ function field_info_field_by_id($field_id) {
}
/**
+ * Returns the same data as field_info_field_by_id() for every field.
+ *
+ * This function is typically used when handling all fields of some entities
+ * to avoid thousands of calls to field_info_field_by_id().
+ *
+ * @return
+ * An array, each key is a field ID and the values are field arrays as
+ * returned by field_read_fields(), with an additional element 'bundles',
+ * whose value is an array of all the bundle this field belongs to.
+ *
+ * @see field_info_field()
+ * @see field_info_field_by_id()
+ */
+function field_info_field_by_ids() {
+ $info = _field_info_collate_fields();
+ return $info['fields'];
+}
+
+/**
* Retrieves information about field instances.
*
* @param $entity_type