diff --git a/~dev_rating/application/classes/Controller/Student/Index.php b/~dev_rating/application/classes/Controller/Student/Index.php index 870173905191d865aae0aafc0abc7adbc266530d..215e848b19f63c6729d797cb3263ce8ca98eb326 100644 --- a/~dev_rating/application/classes/Controller/Student/Index.php +++ b/~dev_rating/application/classes/Controller/Student/Index.php @@ -20,7 +20,7 @@ class Controller_Student_Index extends Controller_UserEnvi { $twig->disciplines = $list; $twig->User = $this->UserInfo; $twig->Semester = $this->SemesterInfo; - $twig->SemesterList = Model_Semesters::create()->getList(); + $twig->SemesterList = Model_Semesters::toArray(); $this->response->body($twig); } diff --git a/~dev_rating/application/classes/Controller/Teacher/Index.php b/~dev_rating/application/classes/Controller/Teacher/Index.php index e4202d427ba242d29d44124eda82e33c68864e8b..e33d0ec6cfdae3f540052ed7a868150392dbdbf9 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Index.php +++ b/~dev_rating/application/classes/Controller/Teacher/Index.php @@ -41,7 +41,7 @@ class Controller_Teacher_Index extends Controller_UserEnvi { $disciplinesHandled[$i]['Disciplines'][$j]['Groups'] = implode(', ', $groupsInDiscipline); } //!for_each $twig->Subjects = $disciplinesHandled; - $twig->SemesterList = Model_Semesters::create()->getList(); + $twig->SemesterList = Model_Semesters::toArray(); $twig->Semester = $this->SemesterInfo; $twig->User = $this->UserInfo; $this->response->body($twig); diff --git a/~dev_rating/application/classes/Model/Semesters.php b/~dev_rating/application/classes/Model/Semesters.php index 3180f1afb0c3af3ca44b9855539fa8302b17d847..77124664ad1e443ff16e59d526cf641b7057de61 100644 --- a/~dev_rating/application/classes/Model/Semesters.php +++ b/~dev_rating/application/classes/Model/Semesters.php @@ -2,10 +2,6 @@ class Model_Semesters extends Model { - public static function create() { - return new self(); - } - /** * @param $id int semester id * @return array data from <tt>semesters</tt> table @@ -15,13 +11,13 @@ class Model_Semesters extends Model return DB::query(Database::SELECT, $sql)->execute()->offsetGet(0); } - public function getSemesters() { + public static function getSemesters() { $sql = "CALL `GetSemesters`()"; return DB::query(Database::SELECT, $sql)->execute(); } - public function getList() { - $semesters = $this->getSemesters(); + public static function toArray() { + $semesters = self::getSemesters(); $list = array(); foreach ($semesters as $row) {