Field Collection Adding Values I'm confused by the field_collection API. I created a Field Collection and attached it to a node (in the GUI) but I can't figure out how to code an update/addition to the field collection. This is my scenario:

I have a node (request) that has product information and quantities. When users go to a product page they see a link to "Add to Request". This link should add the product (nid) to the node request. The difficulty lies in the fact that I need quantity information as well, hence the Field Collection. I added a quantities field and grouped it with the product field.

Node Type: request
Request ID: $requestid
Product ID: $productid
Field Collection = field_request_collection (Unlimited values) 
Field Collection Field = field_products (Entity Reference, Max 1) 
Field Collection Field = field_product_quantities (Integer, Max 1, Default 1) 

My function looks like this (the values for $requestid and $productid are passed in the URL of the link: /my_request/5/12):

function _my_module_request_update($requestid,$productid) {
$nload = node_load($requestid);
$field_collection_item_value = $nload-&gt;field_request_collection[LANGUAGE_NONE][0]['value'];
$field_collection_item = entity_load('field_collection_item', array($field_collection_item_value));
$field_collection_item-&gt;field_products[LANGUAGE_NONE][0]['value'] = intval($productid);
$field_collection_item-&gt;save();
}


The error I'm getting with the above code is:


  PHP Fatal error:  Call to a member function save() on a non-object


Keep in mind that I'm attempting to ADD Field Collection values NOT replace them.  Please help, thanks!
Something like this ought to do the trick:

$nload = node_load($requestid);
$field_collection_item = entity_create('field_collection_item', array('field_name' =&gt; 'field_request_collection'));
$field_collection_item-&gt;setHostEntity('node', $nload);
$field_collection_item-&gt;field_products[LANGUAGE_NONE][0]['target_id'] = intval($productid);
$field_collection_item-&gt;save();

$nload-&gt;field_request_collection[LANGUAGE_NONE][]['value'] = $field_collection_item-&gt;item_id;