@@ -63,7 +63,7 @@ |
||
| 63 | 63 | * Check if user exists before assigning it to a card |
| 64 | 64 | * |
| 65 | 65 | * @param Entity $entity |
| 66 | - * @return null|Entity |
|
| 66 | + * @return AssignedUsers|null |
|
| 67 | 67 | */ |
| 68 | 68 | public function insert(Entity $entity) { |
| 69 | 69 | $user = $this->userManager->get($entity->getParticipant()); |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * @param $cardId |
| 164 | 164 | * @param $attachmentId |
| 165 | 165 | * @param $request |
| 166 | - * @return mixed |
|
| 166 | + * @return \OCP\AppFramework\Db\Entity |
|
| 167 | 167 | * @throws \OCA\Deck\NoPermissionException |
| 168 | 168 | * @throws \OCP\AppFramework\Db\DoesNotExistException |
| 169 | 169 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | use OCA\Deck\Controller\Helper\ApiHelper; |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * Class BoardApiController |
|
| 36 | - * |
|
| 37 | - * @package OCA\Deck\Controller |
|
| 38 | - */ |
|
| 35 | + * Class BoardApiController |
|
| 36 | + * |
|
| 37 | + * @package OCA\Deck\Controller |
|
| 38 | + */ |
|
| 39 | 39 | class LabelApiController extends ApiController { |
| 40 | 40 | |
| 41 | 41 | private $labelService; |
@@ -136,6 +136,9 @@ |
||
| 136 | 136 | return parent::delete($entity); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | + /** |
|
| 140 | + * @param integer $stackId |
|
| 141 | + */ |
|
| 139 | 142 | public function deleteByStack($stackId) { |
| 140 | 143 | $cards = $this->findAllByStack($stackId); |
| 141 | 144 | foreach ($cards as $card) { |
@@ -45,6 +45,9 @@ |
||
| 45 | 45 | return $this->findEntity($sql, [$id]); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $sql |
|
| 50 | + */ |
|
| 48 | 51 | protected function execute($sql, array $params = [], $limit = null, $offset = null) { |
| 49 | 52 | return parent::execute($sql, $params, $limit, $offset); |
| 50 | 53 | } |
@@ -66,6 +66,9 @@ discard block |
||
| 66 | 66 | return $result; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | + /** |
|
| 70 | + * @param integer $labelId |
|
| 71 | + */ |
|
| 69 | 72 | public function deleteLabelAssignments($labelId) { |
| 70 | 73 | $sql = 'DELETE FROM `*PREFIX*deck_assigned_labels` WHERE label_id = ?'; |
| 71 | 74 | $stmt = $this->db->prepare($sql); |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | $stmt->execute(); |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param integer $cardId |
|
| 81 | + */ |
|
| 76 | 82 | public function deleteLabelAssignmentsForCard($cardId) { |
| 77 | 83 | $sql = 'DELETE FROM `*PREFIX*deck_assigned_labels` WHERE card_id = ?'; |
| 78 | 84 | $stmt = $this->db->prepare($sql); |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
| 127 | - * @param $subjectIdentifier |
|
| 127 | + * @param string $subjectIdentifier |
|
| 128 | 128 | * @param array $subjectParams |
| 129 | 129 | * @param bool $ownActivity |
| 130 | 130 | * @return string |
@@ -31,10 +31,10 @@ |
||
| 31 | 31 | use OCA\Deck\Service\CardService; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * Class BoardApiController |
|
| 35 | - * |
|
| 36 | - * @package OCA\Deck\Controller |
|
| 37 | - */ |
|
| 34 | + * Class BoardApiController |
|
| 35 | + * |
|
| 36 | + * @package OCA\Deck\Controller |
|
| 37 | + */ |
|
| 38 | 38 | class CardApiController extends ApiController { |
| 39 | 39 | private $cardService; |
| 40 | 40 | private $userId; |
@@ -31,76 +31,76 @@ |
||
| 31 | 31 | |
| 32 | 32 | class AttachmentApiController extends ApiController { |
| 33 | 33 | |
| 34 | - private $attachmentService; |
|
| 34 | + private $attachmentService; |
|
| 35 | 35 | |
| 36 | - public function __construct($appName, IRequest $request, AttachmentService $attachmentService) { |
|
| 37 | - parent::__construct($appName, $request); |
|
| 38 | - $this->attachmentService = $attachmentService; |
|
| 39 | - } |
|
| 36 | + public function __construct($appName, IRequest $request, AttachmentService $attachmentService) { |
|
| 37 | + parent::__construct($appName, $request); |
|
| 38 | + $this->attachmentService = $attachmentService; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 41 | + /** |
|
| 42 | 42 | * @NoAdminRequired |
| 43 | 43 | * @CORS |
| 44 | 44 | * @NoCSRFRequired |
| 45 | 45 | * |
| 46 | 46 | */ |
| 47 | - public function getAll() { |
|
| 48 | - $attachment = $this->attachmentService->findAll($this->request->getParam('cardId')); |
|
| 49 | - return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 50 | - } |
|
| 47 | + public function getAll() { |
|
| 48 | + $attachment = $this->attachmentService->findAll($this->request->getParam('cardId')); |
|
| 49 | + return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 52 | + /** |
|
| 53 | 53 | * @NoAdminRequired |
| 54 | 54 | * @CORS |
| 55 | 55 | * @NoCSRFRequired |
| 56 | 56 | * |
| 57 | 57 | */ |
| 58 | - public function display() { |
|
| 59 | - $attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); |
|
| 58 | + public function display() { |
|
| 59 | + $attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); |
|
| 60 | 60 | return $attachment; |
| 61 | - } |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 63 | + /** |
|
| 64 | 64 | * @NoAdminRequired |
| 65 | 65 | * @CORS |
| 66 | 66 | * @NoCSRFRequired |
| 67 | 67 | * |
| 68 | 68 | */ |
| 69 | - public function create($type, $data) { |
|
| 70 | - $attachment = $this->attachmentService->create($this->request->getParam('cardId'), $type, $data); |
|
| 71 | - return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 72 | - } |
|
| 69 | + public function create($type, $data) { |
|
| 70 | + $attachment = $this->attachmentService->create($this->request->getParam('cardId'), $type, $data); |
|
| 71 | + return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - /** |
|
| 74 | + /** |
|
| 75 | 75 | * @NoAdminRequired |
| 76 | 76 | * @CORS |
| 77 | 77 | * @NoCSRFRequired |
| 78 | 78 | * |
| 79 | 79 | */ |
| 80 | - public function update($data) { |
|
| 81 | - $attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data); |
|
| 82 | - return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 83 | - } |
|
| 80 | + public function update($data) { |
|
| 81 | + $attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data); |
|
| 82 | + return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - /** |
|
| 85 | + /** |
|
| 86 | 86 | * @NoAdminRequired |
| 87 | 87 | * @CORS |
| 88 | 88 | * @NoCSRFRequired |
| 89 | 89 | * |
| 90 | 90 | */ |
| 91 | - public function delete() { |
|
| 92 | - $attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); |
|
| 93 | - return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 94 | - } |
|
| 91 | + public function delete() { |
|
| 92 | + $attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); |
|
| 93 | + return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - /** |
|
| 96 | + /** |
|
| 97 | 97 | * @NoAdminRequired |
| 98 | 98 | * @CORS |
| 99 | 99 | * @NoCSRFRequired |
| 100 | 100 | * |
| 101 | 101 | */ |
| 102 | - public function restore() { |
|
| 103 | - $attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); |
|
| 104 | - return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 105 | - } |
|
| 102 | + public function restore() { |
|
| 103 | + $attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); |
|
| 104 | + return new DataResponse($attachment, HTTP::STATUS_OK); |
|
| 105 | + } |
|
| 106 | 106 | } |
| 107 | 107 | \ No newline at end of file |