| @@ 52-62 (lines=11) @@ | ||
| 49 | return $this->labelMapper->find($labelId); |
|
| 50 | } |
|
| 51 | ||
| 52 | public function create($title, $color, $boardId) { |
|
| 53 | $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); |
|
| 54 | if ($this->boardService->isArchived(null, $boardId)) { |
|
| 55 | throw new StatusException('Operation not allowed. This board is archived.'); |
|
| 56 | } |
|
| 57 | $label = new Label(); |
|
| 58 | $label->setTitle($title); |
|
| 59 | $label->setColor($color); |
|
| 60 | $label->setBoardId($boardId); |
|
| 61 | return $this->labelMapper->insert($label); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function delete($id) { |
|
| 65 | $this->permissionService->checkPermission($this->labelMapper, $id, Acl::PERMISSION_MANAGE); |
|
| @@ 125-136 (lines=12) @@ | ||
| 122 | /** |
|
| 123 | * @param integer $order |
|
| 124 | */ |
|
| 125 | public function create($title, $boardId, $order) { |
|
| 126 | $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); |
|
| 127 | if ($this->boardService->isArchived(null, $boardId)) { |
|
| 128 | throw new StatusException('Operation not allowed. This board is archived.'); |
|
| 129 | } |
|
| 130 | $stack = new Stack(); |
|
| 131 | $stack->setTitle($title); |
|
| 132 | $stack->setBoardId($boardId); |
|
| 133 | $stack->setOrder($order); |
|
| 134 | return $this->stackMapper->insert($stack); |
|
| 135 | ||
| 136 | } |
|
| 137 | ||
| 138 | public function delete($id) { |
|
| 139 | $this->permissionService->checkPermission($this->stackMapper, $id, Acl::PERMISSION_MANAGE); |
|