public restore ($vobj = false)
Recreate an object from the stored version. Takes any
result from recent()
or history()
.
public static recent ($user = false, $limit = 10, $offset = 0)
Get recent versions by a user or everyone.
public static history ($obj, $limit = 10, $offset = 0)
Get recent versions of an object, or of objects of a specific
class. If $limit
is set to true
(boolean), it will return
a count of the history.
public static diff ($obj1, $obj2)
Compare two versions of a Model object. Returns an array of properties
that have changed between the two versions, but does no comparison
of the changes themselves. Note that this looks at the data array
of the Model objects, not object properties, so it will not work
on ordinary objects, only Model-based objects and objects returned
by the recent()
and history()
methods.
Keeps a change history of any Model object.
Usage:
Fields:
id
- versions idclass
- class name of the objectpkey
- object's 'key' field valueuser
- user id or 0 if no user savedts
- date/time of the changeserialized
- serialized version of the object