SourceForge.net Logo
How it Works

BASIC PERSISTENCE

Persistence of objects is achieved by (transparently) mapping the fields of a PHP object to the fields of a table in a relational database. At the heart of the project is the sqlclass class, which needs to be extended to create a persistent object. The object’s state can then be saved by calling the save() function and loaded with the load(id) function. More complex situations are also catered for, for example a sqlclass-based class may be specified as the child-type of another sqlclass-based class (to an arbitrary depth), loading the parent class will automatically load all its children as well.

ADVANCED PERSISTENCE

More advanced persistence is achieved by a method called object-invocation (in the context of the sqlpersist project). An object can be registered for invocation, giving it an invocation id And name, and can then be invoked at another point in time. The advantage to this approach is that the object’s type does not need to be known (only the invocation id OR name), and that all objects referred to by the object is invoked as well. In this manner creating stateful applications becomes much easier.

 

NOTES (back to top)

* In the future mapping may be to binary files (and perhaps flat files) as well.

[Home] [How it Works] [Project Aims] [Examples] [Project History] [Documentation] [News] [Forums] [Contact Me] [DOWNLOAD]