PHPackages                             the-great-wizard/o-tree - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. the-great-wizard/o-tree

ActiveLibrary[Database &amp; ORM](/categories/database)

the-great-wizard/o-tree
=======================

Simple PHP ORM for tree data structures

017PHP

Since Jan 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/TheGreatWizard/OTree)[ Packagist](https://packagist.org/packages/the-great-wizard/o-tree)[ RSS](/packages/the-great-wizard-o-tree/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

o-tree
======

[](#o-tree)

Simple PHP ORM for tree data structures

1. Build your data object inheriting one of predefined DataObject types: [![alt tag](https://github.com/TheGreatWizard/OTree/raw/master/src/img/diagram.png)](https://github.com/TheGreatWizard/OTree/blob/master/src/img/diagram.png)
2. Connect your data objects to form tree structure
3. Save the tree to database
4. Load the tree starting from the node you choose to the depth you choose

install with composer
=====================

[](#install-with-composer)

```
"require": {
      "the-great-wizard/o-tree": "dev-master"
  }

```

Example
=======

[](#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);

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/20432131f6cfaf3b6cc0dc54c996fdb365e4cb46b0c2e8d51cd32ab7e8c416b0?d=identicon)[grigoryilizirov](/maintainers/grigoryilizirov)

---

Top Contributors

[![TheGreatWizard](https://avatars.githubusercontent.com/u/16478629?v=4)](https://github.com/TheGreatWizard "TheGreatWizard (22 commits)")

### Embed Badge

![Health badge](/badges/the-great-wizard-o-tree/health.svg)

```
[![Health](https://phpackages.com/badges/the-great-wizard-o-tree/health.svg)](https://phpackages.com/packages/the-great-wizard-o-tree)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
