diff options
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/AliasesService.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Service/AliasesService.php b/lib/Service/AliasesService.php index 869d59708..db21e1388 100644 --- a/lib/Service/AliasesService.php +++ b/lib/Service/AliasesService.php @@ -54,6 +54,7 @@ class AliasesService { * @param int $aliasId * @param string $currentUserId * @return Alias + * @throws DoesNotExistException */ public function find(int $aliasId, string $currentUserId): Alias { return $this->aliasMapper->find($aliasId, $currentUserId); @@ -83,6 +84,7 @@ class AliasesService { * @param int $aliasId * @param String $currentUserId * @return Alias + * @throws DoesNotExistException */ public function delete(int $aliasId, string $currentUserId): Alias { $alias = $this->aliasMapper->find($aliasId, $currentUserId); @@ -101,4 +103,18 @@ class AliasesService { public function deleteAll($accountId): void { $this->aliasMapper->deleteAll($accountId); } + + /** + * Update signature for alias + * + * @param string $userId + * @param int $aliasId + * @param string|null $signature + * @throws DoesNotExistException + */ + public function updateSignature(string $userId, int $aliasId, string $signature = null): void { + $alias = $this->find($aliasId, $userId); + $alias->setSignature($signature); + $this->aliasMapper->update($alias); + } } |