/** Fetch a TLORelationship object from the database and add a TLO object to it **/ public function fetch() { if ($obj = $this->_statement->fetch()) { $obj->setDb($this->_db); $obj->storeKeys(); $obj->storeRelation($this->_rel_class, $this->_rel_key_names); # remove the keys $objclass = get_class($obj); foreach (array_merge(TLO::keyNames($objclass::relationMany()), $this->_rel_key_names) as $key) { unset($this->{$key}); } $obj->__setup(); } return $obj; }