Reviewed & tested by the community
Project:
Entity API
Version:
7.x-1.x-dev
Component:
Code - misc
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 May 2012 at 23:47 UTC
Updated:
16 Jan 2018 at 00:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gordon commentedrecreate the patch against 1.x-dev
Comment #3
fagoThis sounds like a good improvement, so let's do it. Maybe we could just assume we have a list of full objects if the first entry is a object ? Supporting mixed lists doesn't make much sense to me.
However, we should note this possibility at the data-type docs ( see hook_entity_property_info()). Then we should add a little code snippet to the tests making use of the functionality, as this is rather foundational it really shouldn't break.
We cannot rely on entities being of class entity, actually most aren't.
Comment #4
rosk0Patch is based on @gordon idea because I think it's totally legit use case when first item in the list will be save object and second will be just added, not saved, but we still want to be able to work with it. I wasn't able to figure proper language to update documentation so help here will be appreciated. Patch also includes parent update for unsaved objects and ability to set unsaved object as list item because without this ability this issue in general will be useful only to field collection because it update parent entity directly, without using wrapper, in its FieldCollectionItemEntity::setHostEntity() method.
Comment #5
rosk0Attempt to update docs.
Comment #6
rosk0Crosslinking.
Comment #7
goldThis is looking good to me. Tests are completing successfully.