-
Notifications
You must be signed in to change notification settings - Fork 327
Expand file tree
/
Copy pathStackController.php
More file actions
74 lines (60 loc) · 1.64 KB
/
StackController.php
File metadata and controls
74 lines (60 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Deck\Controller;
use OCA\Deck\Db\Stack;
use OCA\Deck\Service\StackService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\IRequest;
class StackController extends Controller {
public function __construct(
string $appName,
IRequest $request,
private StackService $stackService,
) {
parent::__construct($appName, $request);
}
/**
* @return Stack[]
*/
#[NoAdminRequired]
public function index(int $boardId): array {
return $this->stackService->findAll($boardId);
}
/**
* @return Stack[]
*/
#[NoAdminRequired]
public function archived(int $boardId): array {
return $this->stackService->findAllArchived($boardId);
}
#[NoAdminRequired]
public function create(string $title, int $boardId, int $order = 999): Stack {
return $this->stackService->create($title, $boardId, $order);
}
#[NoAdminRequired]
public function update(int $id, string $title, int $boardId, int $order, ?int $deletedAt = null): Stack {
return $this->stackService->update($id, $title, $boardId, $order, $deletedAt);
}
/**
* @return array<int, Stack>
*/
#[NoAdminRequired]
public function reorder(int $stackId, int $order): array {
return $this->stackService->reorder($stackId, $order);
}
#[NoAdminRequired]
public function delete(int $stackId): Stack {
return $this->stackService->delete($stackId);
}
/**
* @return Stack[]
*/
#[NoAdminRequired]
public function deleted(int $boardId): array {
return $this->stackService->fetchDeleted($boardId);
}
}