diff options
author | Anna Larch <anna@nextcloud.com> | 2021-05-26 15:12:41 +0200 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2021-05-26 15:12:41 +0200 |
commit | 8fcb3f33c8d5c92fdeb6a870c908fc137aa5e448 (patch) | |
tree | d22ae252199bcbc9e2e9ccd3dd54adffc4f62442 /lib | |
parent | ca49ba644141e1316d98c8476510d0b8ffceb1b3 (diff) | |
download | nextcloud-server-8fcb3f33c8d5c92fdeb6a870c908fc137aa5e448.tar.gz nextcloud-server-8fcb3f33c8d5c92fdeb6a870c908fc137aa5e448.zip |
Add DB exception throws tag to QBMapper PHPDoc
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/AppFramework/Db/QBMapper.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index bf2e1a9420a..4547b092c0a 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -86,10 +86,12 @@ abstract class QBMapper { /** * Deletes an entity from the table + * * @param Entity $entity the entity that should be deleted * @psalm-param T $entity the entity that should be deleted * @return Entity the deleted entity * @psalm-return T the deleted entity + * @throws Exception * @since 14.0.0 */ public function delete(Entity $entity): Entity { @@ -108,10 +110,12 @@ abstract class QBMapper { /** * Creates a new entry in the db from an entity + * * @param Entity $entity the entity that should be created * @psalm-param T $entity the entity that should be created * @return Entity the saved entity with the set id * @psalm-return T the saved entity with the set id + * @throws Exception * @since 14.0.0 */ public function insert(Entity $entity): Entity { @@ -151,6 +155,7 @@ abstract class QBMapper { * @psalm-param T $entity the entity that should be created/updated * @return Entity the saved entity with the (new) id * @psalm-return T the saved entity with the (new) id + * @throws Exception * @throws \InvalidArgumentException if entity has no id * @since 15.0.0 */ @@ -167,11 +172,13 @@ abstract class QBMapper { /** * Updates an entry in the db from an entity - * @throws \InvalidArgumentException if entity has no id + * * @param Entity $entity the entity that should be created * @psalm-param T $entity the entity that should be created * @return Entity the saved entity with the set id * @psalm-return T the saved entity with the set id + * @throws Exception + * @throws \InvalidArgumentException if entity has no id * @since 14.0.0 */ public function update(Entity $entity): Entity { @@ -255,12 +262,13 @@ abstract class QBMapper { * Returns an db result and throws exceptions when there are more or less * results * - * @see findEntity - * * @param IQueryBuilder $query - * @throws DoesNotExistException if the item does not exist - * @throws MultipleObjectsReturnedException if more than one item exist * @return array the result as row + * @throws Exception + * @throws MultipleObjectsReturnedException if more than one item exist + * @throws DoesNotExistException if the item does not exist + * @see findEntity + * * @since 14.0.0 */ protected function findOneQuery(IQueryBuilder $query): array { @@ -319,6 +327,7 @@ abstract class QBMapper { * @param IQueryBuilder $query * @return Entity[] all fetched entities * @psalm-return T[] all fetched entities + * @throws Exception * @since 14.0.0 */ protected function findEntities(IQueryBuilder $query): array { @@ -341,10 +350,11 @@ abstract class QBMapper { * results * * @param IQueryBuilder $query - * @throws DoesNotExistException if the item does not exist - * @throws MultipleObjectsReturnedException if more than one item exist * @return Entity the entity * @psalm-return T the entity + * @throws Exception + * @throws MultipleObjectsReturnedException if more than one item exist + * @throws DoesNotExistException if the item does not exist * @since 14.0.0 */ protected function findEntity(IQueryBuilder $query): Entity { |