-
Committer:
Anthony Bush
-
Date:
2010-09-26 23:50:02 UTC
-
Revision ID:
anthony@anthonybush.com-20100926235002-k7740i89b9b29ir3
- CoughCollection:
- Calling save() on a collection now returns true if all elements saved successfully.
- Changed getLast() to return null when there are no items in the collection.
- get() now behaves like remove() (works with objects).
- add() now behaves like remove() (returns added object).
- Improved robustness of removeByKey() (when null key is given).
- Improved algorithm for issuing temporary keys: adding a new object twice now adds it to the collection only once.
- CoughObject:
- Improved toggling of isNew.
- Improved save(): chains such as collection saving and reseting modified fields are only executed if save was successful.
- Fixed issue when cloning objects that make use of comparing modified fields to their original values.
- setModifiedField() now saves the original value for later retrieval; it did this before, but multiple calls to set*() would override the *true* original value.
- Added getOldFieldValue($fieldName): use for retriving original value for a field (use when writing app-based save() triggers).
- Added isFieldDifferent($fieldName): shortcut for finding out if a field wasn't just modified, but was modified to a different value (use when writing app-based save() triggers).
- CoughDatabaseFactory:
- Added saveToMemento() and restoreFromMemento().