diff --git a/~dev_rating/application/classes/Controller/Handler/GetData.php b/~dev_rating/application/classes/Controller/Handler/GetData.php index fda586bc384c90d905c8c7d0aa542a62b036ac95..c2683ccf03a2edd2c562b7b127f65f6e1cd799c0 100644 --- a/~dev_rating/application/classes/Controller/Handler/GetData.php +++ b/~dev_rating/application/classes/Controller/Handler/GetData.php @@ -32,9 +32,8 @@ class Controller_Handler_GetData extends Controller_Handler $this->post -> rule('GroupID', 'not_empty') -> rule('GroupID', 'digit'); if($this->post->check()) { - $data['data'] = Model_Disciplines::create()->forGroup( - $this->post->offsetGet('GroupID'))->asArray(); - + $group = $this->post->offsetGet('GroupID'); + $data['data'] = Model_Disciplines::forGroup($group); $data['success'] = true; } $this->response->body(json_encode($data)); diff --git a/~dev_rating/application/classes/Model/Disciplines.php b/~dev_rating/application/classes/Model/Disciplines.php index 6f26dcfba457dac3b60afa8360be02b53e24dec5..e2fc7bbc894380711381ef76e2948369fd9b45cc 100644 --- a/~dev_rating/application/classes/Model/Disciplines.php +++ b/~dev_rating/application/classes/Model/Disciplines.php @@ -2,11 +2,7 @@ class Model_Disciplines extends Model { - public static function create() { - return new self(); - } - - public function forGroup($GroupID) { + public static function forGroup($GroupID) { $teacherModel = new Model_Teacher_Rating; $disciplines = $teacherModel->getDisciplinesForGroup($GroupID); @@ -14,7 +10,7 @@ class Model_Disciplines extends Model foreach ($disciplines as $row) $list[] = $row; - return new DataArray_Result($list); + return $list; } /**