| @@ 105-118 (lines=14) @@ | ||
| 102 | /** |
|
| 103 | * @param integer $order |
|
| 104 | */ |
|
| 105 | public function create($title, $stackId, $type, $order, $owner) { |
|
| 106 | $this->permissionService->checkPermission($this->stackMapper, $stackId, Acl::PERMISSION_EDIT); |
|
| 107 | if ($this->boardService->isArchived($this->stackMapper, $stackId)) { |
|
| 108 | throw new StatusException('Operation not allowed. This board is archived.'); |
|
| 109 | } |
|
| 110 | $card = new Card(); |
|
| 111 | $card->setTitle($title); |
|
| 112 | $card->setStackId($stackId); |
|
| 113 | $card->setType($type); |
|
| 114 | $card->setOrder($order); |
|
| 115 | $card->setOwner($owner); |
|
| 116 | return $this->cardMapper->insert($card); |
|
| 117 | ||
| 118 | } |
|
| 119 | ||
| 120 | public function delete($id) { |
|
| 121 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
|
| @@ 151-162 (lines=12) @@ | ||
| 148 | } |
|
| 149 | ||
| 150 | ||
| 151 | public function update($id, $title, $boardId, $order, $deletedAt) { |
|
| 152 | $this->permissionService->checkPermission($this->stackMapper, $id, Acl::PERMISSION_MANAGE); |
|
| 153 | if ($this->boardService->isArchived($this->stackMapper, $id)) { |
|
| 154 | throw new StatusException('Operation not allowed. This board is archived.'); |
|
| 155 | } |
|
| 156 | $stack = $this->stackMapper->find($id); |
|
| 157 | $stack->setTitle($title); |
|
| 158 | $stack->setBoardId($boardId); |
|
| 159 | $stack->setOrder($order); |
|
| 160 | $stack->setDeletedAt($deletedAt); |
|
| 161 | return $this->stackMapper->update($stack); |
|
| 162 | } |
|
| 163 | ||
| 164 | public function reorder($id, $order) { |
|
| 165 | $this->permissionService->checkPermission($this->stackMapper, $id, Acl::PERMISSION_EDIT); |
|