| @@ 285-296 (lines=12) @@ | ||
| 282 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException |
|
| 283 | * @throws BadRequestException |
|
| 284 | */ |
|
| 285 | public function delete($id) { |
|
| 286 | ||
| 287 | if (is_numeric($id) === false) { |
|
| 288 | throw new BadRequestException('board id must be a number'); |
|
| 289 | } |
|
| 290 | ||
| 291 | $this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_READ); |
|
| 292 | $board = $this->find($id); |
|
| 293 | $board->setDeletedAt(time()); |
|
| 294 | $this->boardMapper->update($board); |
|
| 295 | return $board; |
|
| 296 | } |
|
| 297 | ||
| 298 | /** |
|
| 299 | * @param $id |
|
| @@ 305-315 (lines=11) @@ | ||
| 302 | * @throws \OCA\Deck\NoPermissionException |
|
| 303 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException |
|
| 304 | */ |
|
| 305 | public function deleteUndo($id) { |
|
| 306 | ||
| 307 | if (is_numeric($id) === false) { |
|
| 308 | throw new BadRequestException('board id must be a number'); |
|
| 309 | } |
|
| 310 | ||
| 311 | $this->permissionService->checkPermission($this->boardMapper, $id, Acl::PERMISSION_READ); |
|
| 312 | $board = $this->find($id); |
|
| 313 | $board->setDeletedAt(0); |
|
| 314 | return $this->boardMapper->update($board); |
|
| 315 | } |
|
| 316 | ||
| 317 | /** |
|
| 318 | * @param $id |
|
| @@ 210-225 (lines=16) @@ | ||
| 207 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException |
|
| 208 | * @throws BadRequestException |
|
| 209 | */ |
|
| 210 | public function delete($id) { |
|
| 211 | ||
| 212 | if ( is_numeric($id) === false ) { |
|
| 213 | throw new BadRequestException('stack id must be a number'); |
|
| 214 | } |
|
| 215 | ||
| 216 | $this->permissionService->checkPermission($this->stackMapper, $id, Acl::PERMISSION_MANAGE); |
|
| 217 | ||
| 218 | $stack = $this->stackMapper->find($id); |
|
| 219 | $stack->setDeletedAt(time()); |
|
| 220 | $this->stackMapper->update($stack); |
|
| 221 | ||
| 222 | $this->enrichStackWithCards($stack); |
|
| 223 | ||
| 224 | return $stack; |
|
| 225 | } |
|
| 226 | ||
| 227 | /** |
|
| 228 | * @param $id |
|