Quick search:


How to write your own persistency

The easiest way to combine your own persistency with phpPeanuts is probably to create your own PntClassDescriptor subclass. The framework will instantiate this class if you override a method getClassDescriptorClass on the peanut class. You will probably subclass all peanuts classes using your own persistency from a common superclass. If so, you can override the getClassDescriptorClass there. You can use PntDbClassDescriptor as an example.

Be aware that part of the persistency is implemented on PntDbObject. For example, ObjectSaveAction will call the save method on a peanut after it has successfully modified it, in order to save it to the database. The save method is implemented in PntDbObject.

Be aware that the user interface framework uses objects like instances of PntSqlFilter, PntSqlSort and QueryHandler for generating SQL from navigational query specifications in terms of the domain model. If you do not somehow include these objects into your persistency, you may have to override or not use parts of the user-interfacing framework.


You can write your persistency like peanut managed persistency by delegating everything to the peanut class, or like container managed persistency by delegating it to an object sprecif to your deployment specialization layer, see How to
keep your application code separated from customization code