<?php error_reporting(E_ALL); require_once 'Config.inc.php'; require_once 'lib/Test.classes.php'; require_once 'lib/CodeListing.classes.php'; #CodeListing::classes('Orm'); # public static function t($name, $func, $params, $against_func_str /* $result is passed into this function */, $hide_stack_trace = false) Test::init(); SSql::query("DELETE FROM person WHERE dna_seq = 'abcxyz' AND surname = 'Bloggs' AND given_name = 'Joe'"); new Person(OrmClass::CONSTR_CMD_POP_FROM_ARR, NULL, array('dna_seq' => 'abcxyz', 'surname' => 'Bloggs', 'given_name' => 'Joe')); #SSql::$debug = true; foreach (Orm::load('Person') as $o) { print_r($o); print_r($o->getRelsByClass('Office')); #print_r($habitation = $o->getRelsByClasses('Home', 'LivesIn')); print_r($habitation = $o->getRelsByClasses('Home', 'LivesIn', 'Person -> (LivesIn) -> Home')); print_r($habitation->classHome[0]); print_r($habitation->classLivesIn[0]); } #OrmSqlCache::save(); # suggested tests # 1. Orm::load # 2. OrmClass->getRelsByClasses() for direct relation # 3. OrmClass->getRelsByClasses() for indirect relation # 4. OrmClass->getRelsByClasses() for multiple relations # 5. OrmClass->getRelsByClasses() with chain # 6. OrmClass->getRelsByClasses() with chains # 7. OrmClass->getRelsByClass() without and with chain # TODO # consider adding an incrementing integer to alias so that multiple passes of the same rule are ok