the-great-wizard / o-tree
Simple PHP ORM for tree data structures
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/the-great-wizard/o-tree
Requires
- monolog/monolog: 1.22.*
- php-console/php-console: *
- psr/log: 1.0.*
This package is not auto-updated.
Last update: 2026-01-04 03:09:43 UTC
README
Simple PHP ORM for tree data structures
-
Build your data object inheriting one of predefined DataObject types:

-
Connect your data objects to form tree structure
-
Save the tree to database
-
Load the tree starting from the node you choose to the depth you choose
install with composer
"require": {
"the-great-wizard/o-tree": "dev-master"
}
Example
// database connection configurations
define('DB_NAME', 'your_mysql_DB');
define('DB_USER', 'your_mysql_user');
define('DB_PASSWORD', 'your_mysql_password');
define('DB_HOST', '127.0.0.1');
// build an object that inherit DataObject.
$obj = new \DAL\DummyDataObject();
var_dump($obj);
// get database handle
$hld = new \DAL\HighLevelDAL();
// save the data object to database
$hld->saveDataObject($obj, 1);
// load the data object from database
$loadedObj = $hld->loadDataObject($obj->getCombinedId(), 1);
var_dump($loadedObj);