Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
I suggest adding a new feature called @DynamicFields. The idea is from roman and documeneted here: http://github.com/romanb/couchdb-persistence-api/blob/master/src/main/java/org/code_factory/couch/annotations/DynamicFields.java
Idea: Save all "left-over" fields of the result in an array.
This would greatly enhance the flexibility of document mappers
Nice idea! So something like this could essentially work:
/** @Document */ class User { /** @DynamicFields */ public $data; } $user = $dm->find(....); echo $user->data['username'];I am not sure if it is a good idea to just allow them to use a single @DynamicFields, maybe we should throw an exception if they use it that way? Also, if they modify a value inside $data should we persist the changes?