Load field collections

Public

Get raw version
php
  1. $collections = array();
  2. $field_collection_fields = field_get_items($entity_type, $entity_object, $field_collection_name);
  3. foreach ($field_collection_fields as $field_collection_field) {
  4. // Load the field collection entity...
  5. $collection_entity = entity_load('field_collection_item', array($field_collection_field['value']));
  6. $collections[] = current($collection_entity);
  7. }