Table of Contents
Why
Objects without sql
I wanted to write a database class that can handle any object with its custom properties. My objects should just set a value and store it.
Like that:
$o->new();
$o->set('label', 'my label'); // set properties
$o->set('description', 'This is a nice description.');
$o->save(); // store to database
All needed database actions are handled in a base class. All objects just extend it.
Debugging, logging
On top is a database class that handles database queries, logging, debugging and performance data.
Relations
There is a global relation table that links all objects. This link is transparent for both objects.
Overview
This is the result of this project:
flowchart TD
A(database class):::orange --- B(class with abstract object actions):::orange
B -..- |extends| C1[your object 1]:::gray
B -..- |extends| C2[your object 2]:::gray
B -..- |extends| C3[your object N]:::gray
B -.- |extends| D[Relations]:::orange
classDef orange fill:#ec8,stroke:#a92
classDef gray fill:#eee,stroke:#aaa