2017 © Pedro Peláez
 

library o-tree

Simple PHP ORM for tree data structures

image

the-great-wizard/o-tree

Simple PHP ORM for tree data structures

  • Friday, January 27, 2017
  • by grigoryilizirov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

o-tree

Simple PHP ORM for tree data structures, (*1)

  1. Build your data object inheriting one of predefined DataObject types: alt tag, (*2)

  2. Connect your data objects to form tree structure, (*3)

  3. Save the tree to database, (*4)

  4. Load the tree starting from the node you choose to the depth you choose, (*5)

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);

The Versions

27/01 2017

dev-master

9999999-dev

Simple PHP ORM for tree data structures

  Sources   Download

MIT

The Requires

 

by Grigory Ilizirov