| @@ 37-45 (lines=9) @@ | ||
| 34 | $this->useCaseUpdate($projet); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function deleteAction($id = null) |
|
| 38 | { |
|
| 39 | $object = call_user_func($this->model . '::findFirst', "$id"); |
|
| 40 | $object->delete(); |
|
| 41 | ||
| 42 | $this->useCaseUpdate($object); |
|
| 43 | $this->response->redirect("$this->controller/index"); |
|
| 44 | $this->response->redirect($_SERVER['HTTP_REFERER'] . "/2"); |
|
| 45 | } |
|
| 46 | ||
| 47 | public function useCaseUpdate($obj) |
|
| 48 | { |
|
| @@ 61-72 (lines=12) @@ | ||
| 58 | return $object; |
|
| 59 | } |
|
| 60 | ||
| 61 | public function readAction($id = NULL) |
|
| 62 | { |
|
| 63 | if ($this->verifyAccessAction($this->controller, "read")) { |
|
| 64 | if ($id != null) { |
|
| 65 | $object = call_user_func($this->model . '::find', "id = $id"); |
|
| 66 | $this->view->setVar("object", $object); |
|
| 67 | $this->view->pick("main/read"); |
|
| 68 | } |
|
| 69 | }else{ |
|
| 70 | ||
| 71 | } |
|
| 72 | } |
|
| 73 | ||
| 74 | ||
| 75 | protected function setValuesToObject(&$object) |
|
| @@ 126-133 (lines=8) @@ | ||
| 123 | } |
|
| 124 | ||
| 125 | ||
| 126 | public function deleteAction($id = null) |
|
| 127 | { |
|
| 128 | if ($this->verifyAccessAction($this->controller, "write")) { |
|
| 129 | $object = call_user_func($this->model . '::findFirst', "$id"); |
|
| 130 | $object->delete(); |
|
| 131 | } |
|
| 132 | ||
| 133 | $this->response->redirect("$this->controller/index"); |
|
| 134 | } |
|
| 135 | ||
| 136 | public function asAdminAction() |
|