/** Update the appropriate line in the DB to NULLs and load it, returning that object **/ public static function newObject(PDO $db, $relationship, TLO $one, TLO $many) { $location_class = $relationship::relationMany(); $relation_class = $relationship::relationOne(); $query = self::sqlCreate($relationship); $params = array(); foreach ($one->getKeys($relation_class) as $key => $val) { $params[] = $val; } foreach ($many->getKeys($location_class) as $key => $val) { $params[] = $val; } $s = TLO::prepare($db, $query); TLO::execute($s, $params); return TLORelationship::getOne($db, $relationship, $many); }
public function testDeleteDefaultDb() { $t = TLO::getObject($this->db, 'Test1', array($this->guid3)); $connected_to = TLORelationship::getOne($this->db, 'ConnectedTo', $t); $connected_to->delete(); $this->assertFalse(TLORelationship::getOne($this->db, 'ConnectedTo', $t)); }