Skip to main content
Post Closed as "Not suitable for this site" by kenorb, Adrian Cid Almaguer, Krishna Mohan, No Sssweat, Scott Joudry
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link
kiranking
  • 330
  • 5
  • 21

how to get weight or delta of current field collection item that is being computed

Is it possible to get weight(order index) of multi field "field collection".This weight is needed inside computed field which is inside field collection.I tried the following but it returns empty

$wrapper = entity_metadata_wrapper('field_collection_item', $entity);    
$instance = field_read_instance('field_collection_item',$wrapper, 'bundle_name');
dpm($instance['widget']['weight']);

Here is the structure

main_content-contains field collection (multi value)
------field collection(s)-contains 1 text field and 1 computed field
------|----item 0
------|-------|-------computed_field <---here how to get weight of field collection item ie 0
------|----item 1
------|-------|-------computed_field <---here how to get weight of field collection item ie 1
------|----item 2
------|-------|-------computed_field
------|----item n
------|-------|-------computed_field