get("Survey", array("uid" => $args->uid)); if (!empty($survey_results)) { $survey = $survey_results[0]; } else { die("No survey found!"); } $question->questions = array(); foreach ($args->questions->uids as $questionUid) { $question_results = $dbi->get("Question", array("code"=>$questionUid)); $question = $question_results[0]; $survey->questions[] = $question; } // The next part is a rather experimental way of automatically writing all passed arguments to the session object. // If this does not work properly, we should write the "write title to session->title" call by hand. /* foreach ($args as $key=>$value) { $session->$key = $value; } */ var_dump($survey); // Do I need to check if this is done before proceeding? $dbi->set($survey); ?>