Skip to content
Snippets Groups Projects
Commit ff28bc86 authored by xamgore's avatar xamgore
Browse files

Removed create method from Disciplines model

parent 8711b19d
Branches
Tags
No related merge requests found
...@@ -32,9 +32,8 @@ class Controller_Handler_GetData extends Controller_Handler ...@@ -32,9 +32,8 @@ class Controller_Handler_GetData extends Controller_Handler
$this->post -> rule('GroupID', 'not_empty') $this->post -> rule('GroupID', 'not_empty')
-> rule('GroupID', 'digit'); -> rule('GroupID', 'digit');
if($this->post->check()) { if($this->post->check()) {
$data['data'] = Model_Disciplines::create()->forGroup( $group = $this->post->offsetGet('GroupID');
$this->post->offsetGet('GroupID'))->asArray(); $data['data'] = Model_Disciplines::forGroup($group);
$data['success'] = true; $data['success'] = true;
} }
$this->response->body(json_encode($data)); $this->response->body(json_encode($data));
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
class Model_Disciplines extends Model class Model_Disciplines extends Model
{ {
public static function create() { public static function forGroup($GroupID) {
return new self();
}
public function forGroup($GroupID) {
$teacherModel = new Model_Teacher_Rating; $teacherModel = new Model_Teacher_Rating;
$disciplines = $teacherModel->getDisciplinesForGroup($GroupID); $disciplines = $teacherModel->getDisciplinesForGroup($GroupID);
...@@ -14,7 +10,7 @@ class Model_Disciplines extends Model ...@@ -14,7 +10,7 @@ class Model_Disciplines extends Model
foreach ($disciplines as $row) foreach ($disciplines as $row)
$list[] = $row; $list[] = $row;
return new DataArray_Result($list); return $list;
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment