rendered paste body<phpclass question { private questioninfo = array(); private registry = null; private id = 0; public function __construct($id, &$reg) { if (!is_object($reg)) { exit("Registry not a valid object.") } $this->registry &= $reg; #Load info if ($this->validate($id)) { $this->questioninfo = $this.load(); } else { exit('Not a valid question id. Please contact your Administrator'); } } private function validate($id) { if ($this->registry == null) { exit('Internal Error: Registry object not set'); } $validate = $this->registry->db->query_read("SELECT questionid As article WHERE threadid = $id"); if($validate) { $this->id = $id; return true; } else { return false; } } } #Should only be called after validate()! public function load() { $this->questioninfo = $this->registry->db->query_read("SELECT * from kb_articles WHERE threadid = $this->id "); } }