Get
get
getEdit
get(entityOrUid)
get(entityOrUid)
Gets an immutable item from the cache. The item is deeply frozen. No dependent entities inside the object are editable.
Parameters
entityOrUid
Object | string
either the object's unique id or a stale version of the object. The cache retrieves its uid and returns the Cache copy.
Returns
*
, the cache copy of the object or null if none is present
getEdit(entityOrUid)
getEdit(entityOrUid)
Same as get()
only retrieves a new deeply editable instance of the item cached. This instance can be edited and put back into the Cache. This creates a new cached version of the entity. The previous version is still available via an undo()
operation. Identity comparisons of this entity with previous versions fail.
This is valid event if the referenced entity is inside an array. It updates cache wide
*IMPORTANT getEdit()
dynamic
getEdit()
dynamicGetting an editable object from the cache only clones contained items that have NO UID. This is for performance reasons. Because of that you should always getEdit()
the cache item "closest to your uid".
Last updated