Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $entity_type = "field_collection_item";
- $blueprint_obj = entity_create($entity_type, array('field_name' => "field_blueprints") );
- $blueprint_obj->setHostEntity('node', $order);
- $blueprint_entity = entity_metadata_wrapper($entity_type, $blueprint_obj);
- date_default_timezone_set("UTC");
- $blueprint_entity->field_blueprint_file->file->set((array)$file);
- $blueprint_entity->field_blueprint_comment = (string) $file->filename;
- $blueprint_obj->save();
- node_save($order);
- EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set() (line 736 of /sites/masterprint/public_html/sites/all/modules/entity/includes/entity.wrapper.inc).
- $blueprint_entity->field_blueprint_file->set((array)$file)
- $blueprint_entity->field_blueprint_file->set(array('fid'=>$file->fid))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement