| @@ 130-141 (lines=12) @@ | ||
| 127 | * |
|
| 128 | * @return void |
|
| 129 | */ |
|
| 130 | public function edit() |
|
| 131 | { |
|
| 132 | $data = $this->request->post->get(); |
|
| 133 | if ( ! array_key_exists('hummingbird_id', $data)) |
|
| 134 | { |
|
| 135 | $this->redirect("collection/view", 303); |
|
| 136 | } |
|
| 137 | ||
| 138 | $this->anime_collection_model->update($data); |
|
| 139 | ||
| 140 | $this->redirect("collection/view", 303); |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * Add a collection item |
|
| @@ 148-159 (lines=12) @@ | ||
| 145 | * |
|
| 146 | * @return void |
|
| 147 | */ |
|
| 148 | public function add() |
|
| 149 | { |
|
| 150 | $data = $this->request->post->get(); |
|
| 151 | if ( ! array_key_exists('id', $data)) |
|
| 152 | { |
|
| 153 | $this->redirect("collection/view", 303); |
|
| 154 | } |
|
| 155 | ||
| 156 | $this->anime_collection_model->add($data); |
|
| 157 | ||
| 158 | $this->redirect("collection/view", 303); |
|
| 159 | } |
|
| 160 | ||
| 161 | /** |
|
| 162 | * Remove a collection item |
|
| @@ 166-177 (lines=12) @@ | ||
| 163 | * |
|
| 164 | * @return void |
|
| 165 | */ |
|
| 166 | public function delete() |
|
| 167 | { |
|
| 168 | $data = $this->request->post->get(); |
|
| 169 | if ( ! array_key_exists('id', $data)) |
|
| 170 | { |
|
| 171 | $this->redirect("collection/view", 303); |
|
| 172 | } |
|
| 173 | ||
| 174 | $this->anime_collection_model->delete($data); |
|
| 175 | ||
| 176 | $this->redirect("collection/view", 303); |
|
| 177 | } |
|
| 178 | } |
|
| 179 | // End of CollectionController.php |
|