How to get the NodeID from ItemID of connect Item from Field Collection I have a nodetype which is has a connected field collection (multiple values). In this case one of items of the collection is a date and I have got the ID of this one. So:

field_collection_item_load($did);


takes me just half the way home, since I still need some data of the node, hosting this collection, which in turn holds that item.

Illustration:

node // need that id
  + dates (Field Collection)
     + item (of item of the field collection)
       + ....
       + date // got this id
       + more fields
     + ...
     + more items


Any Ideas?
you may want to try hostEntity() method (link)


  Returns the host entity, which embeds this field collection item.


Then you'll be able to extract nid from the result returned by hostEntity().

but it is not clear what are you loading with field_collection_item_load($did); 

is $did the id of the field_collection item - meaning the field collection and not the field in it? if so, than you can do something like this

$entity = entity_load_single('field_collection_item', $did);
$host_entity = $entity-&gt;hostEntity();
$nid = $host_entity-&gt;nid;  // returns node id of the node that hosts given field collection