Ejemplo n.º 1
0
 /** Load and store the relation object **/
 public final function storeRelation($class, $key_names)
 {
     $rel_keys = array();
     foreach ($key_names as $key) {
         $rel_keys[] = $this->{$key};
     }
     $this->setRelation(TLO::getObject($this->_db, $class, $rel_keys));
 }
Ejemplo n.º 2
0
 public function testRelationshipResultIteration()
 {
     $t = TLO::getObject($this->db, 'Test3', array($this->guid2));
     foreach (TLORelationship::getMany($this->db, 'ConnectedTo', $t) as $i => $o) {
         $this->assertNoPattern('/[^0-9]/', $i);
         $this->assertIsA($o, 'ConnectedTo');
         $this->assertIsA($o->getRelation(), 'Test1');
     }
     $this->assertEqual($i, 2);
 }