/** * @param int $from * @param int $to * @throws Task_Not_Found */ private function showGoals($from, $to) { $this->load->library("session"); $goals = new Goal(); $goals->where("user_id", $this->session->getStudentId()); $goals->where("start >=", $from); $goals->where("end <=", $to); $goals->get(); $goalsView = array(); /** @var Goal $goal */ foreach ($goals as $goal) { $goalsView[] = array("id" => $goal->getId(), "value" => $goal->getValue(), "done" => $goal->getDoneTime(), "task_name" => $goal->task->getName()); } $this->load->view("goal/get", array("goals" => $goalsView)); }