2017 © Pedro Peláez
 

silverstripe-module silverstripe-persistent-dataobject

Persistent and optionally immutable & versioned DataObjects for SilverStripe

image

zauberfisch/silverstripe-persistent-dataobject

Persistent and optionally immutable & versioned DataObjects for SilverStripe

  • Tuesday, January 16, 2018
  • by Zauberfisch
  • Repository
  • 1 Watchers
  • 2 Stars
  • 53 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 13 % Grown

The README.md

Persistent DataObjects - Experimental / Work in Progress

Persistent and optionally immutable & versioned DataObjects for SilverStripe, (*1)

The two major features of this module are:, (*2)

  1. A DataObject subclass that can not be deleted
    Calling ->delete() will mark an object as deleted, but not actually delete it
    (Where necessary, objects can still be deleted by calling ->purge())
  2. A DataObjectExtension that adds versioning
    In contrast to the "silverstripe-versioned" module, versioning is achived by making DataObjects immutable and overloading ->write() to create a duplicate of the current record instead of saving the existing.
    This means the ID becomes the unique version number, while an additional VersionGroupID and VersionGroupLatest keep track of the relation of records. The benefit of this approach is being able to easily reference a version of an entry rather than always the latest version. Thus making it possible to have persistent storage of information that is easily integrable in other parts of SilverStripe (eg an invoice can safely reference a product price and does not need to create a snapshot).

TODOs / Planed features

  • [ ] Tests
  • [ ] Revisit decision to put VersionGroup_ID on DataObject rather than subclasses
  • [ ] Extend GridField integration
    • [ ] Hide/Show deleted records button
    • [ ] History view to access older version from within a DataObject
  • [ ] Implement non GridField form fields (eg Relation Dropdown that let's the user pick a entry and a version)
  • [ ] Implement Database Field/Relation that references VersionGroupID instead of ID?
  • [ ] Documentation
    • [ ] Explain the usecase in more detail
    • [ ] Examples
  • [ ] SilverStripe 4 Support

The Versions

16/01 2018

dev-master

9999999-dev https://github.com/Zauberfisch/silverstripe-persistent-dataobject

Persistent and optionally immutable & versioned DataObjects for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar Zauberfisch

silverstripe persistent immutable dataobject versioned

16/01 2018

v1.0.0-alpha2

1.0.0.0-alpha2 https://github.com/Zauberfisch/silverstripe-persistent-dataobject

Persistent and optionally immutable & versioned DataObjects for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar Zauberfisch

silverstripe persistent immutable dataobject versioned

24/08 2017

v1.0.0-alpha1

1.0.0.0-alpha1 https://github.com/Zauberfisch/silverstripe-persistent-dataobject

Persistent and optionally immutable & versioned DataObjects for SilverStripe

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar Zauberfisch

silverstripe persistent immutable dataobject versioned