Type hint IPermissionMapper

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-11-04 19:52:16 +01:00
parent 9b366857ab
commit f031717a54
8 changed files with 17 additions and 17 deletions

View File

@@ -92,14 +92,14 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
$stmt->execute();
}
public function isOwner($userId, $labelId) {
public function isOwner($userId, $labelId): bool {
$sql = 'SELECT owner FROM `*PREFIX*deck_boards` WHERE `id` IN (SELECT board_id FROM `*PREFIX*deck_labels` WHERE id = ?)';
$stmt = $this->execute($sql, [$labelId]);
$row = $stmt->fetch();
return ($row['owner'] === $userId);
}
public function findBoardId($labelId) {
public function findBoardId($labelId): ?int {
$entity = $this->find($labelId);
return $entity->getBoardId();
}