uid = $uid; $this->title = $title; $this->description = $description; $this->creator = $creator; $this->questions = $questions; } /** * function evaluate() * Evaluates the references */ public function evaluate() { $dbi = new DatabaseInterface(); if(is_string($this->creator)) { $result = $dbi->get("user", array("uid" => $this->creator)); if(!isset($result[0])) return false; $this->creator = $result[0]; } if(!empty($this->questions) && is_string($this->questions[0])) { $newQuestions = array(); foreach($this->questions as $question) { $result = $dbi->get("question", array("uid" => $question)); if(!isset($result[0])) return false; $newQuestions[] = $result[0]; } $this->questions = newQuestions; } return true; } } ?>