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
$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));
......
......@@ -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;
}
/**
......
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