diff --git a/lib/Controller/DirectoryController.php b/lib/Controller/DirectoryController.php index d10e970c..211bf86f 100644 --- a/lib/Controller/DirectoryController.php +++ b/lib/Controller/DirectoryController.php @@ -78,7 +78,7 @@ public function update(): JSONResponse $url = $this->request->getParam('directory'); // Sync the external directory with the provided URL - try{ + try { $data = $this->directoryService->syncExternalDirectory($url); } catch (DirectoryUrlException $exception) { if($exception->getMessage() === 'URL is required') { diff --git a/lib/Controller/ListingsController.php b/lib/Controller/ListingsController.php index 63b24bb5..450a6166 100644 --- a/lib/Controller/ListingsController.php +++ b/lib/Controller/ListingsController.php @@ -188,7 +188,7 @@ public function add(): JSONResponse $url = $this->request->getParam('url'); // Add the new listing using the provided URL - try{ + try { $result = $this->directoryService->syncExternalDirectory($url); } catch (DirectoryUrlException $exception) { if($exception->getMessage() === 'URL is required') { diff --git a/lib/Db/AttachmentMapper.php b/lib/Db/AttachmentMapper.php index f5eec661..0832eaaf 100644 --- a/lib/Db/AttachmentMapper.php +++ b/lib/Db/AttachmentMapper.php @@ -126,7 +126,7 @@ public function createFromArray(array $object): Attachment * @throws DoesNotExistException If the entity is not found * @throws MultipleObjectsReturnedException|\OCP\DB\Exception If multiple entities are found */ - public function updateFromArray(int $id, array $object, bool $updateVersion = true): Attachment + public function updateFromArray(int $id, array $object, bool $updateVersion = true, bool $patch = false): Attachment { $attachment = $this->find($id); // Fallback to create if the attachment does not exist diff --git a/lib/Db/CatalogMapper.php b/lib/Db/CatalogMapper.php index 825597de..6bb66f91 100644 --- a/lib/Db/CatalogMapper.php +++ b/lib/Db/CatalogMapper.php @@ -140,9 +140,9 @@ public function createFromArray(array $object): Catalog * * @return Catalog The updated Catalog entity */ - public function updateFromArray(int $id, array $object, bool $updateVersion = true): Catalog + public function updateFromArray(int $id, array $object, bool $updateVersion = true, bool $patch = false): Catalog { - $catalog = $this->find($id); + $catalog = $this->find($id); // Fallback to create if the catalog does not exist if ($catalog === null) { $object['uuid'] = $id; diff --git a/lib/Db/ListingMapper.php b/lib/Db/ListingMapper.php index 21a4300d..05ddab36 100644 --- a/lib/Db/ListingMapper.php +++ b/lib/Db/ListingMapper.php @@ -234,7 +234,7 @@ public function createFromArray(array $object): Listing * @return Listing The updated Listing entity * @throws Exception */ - public function updateFromArray(int|string $id, array $object, bool $updateVersion = true): Listing + public function updateFromArray(int|string $id, array $object, bool $updateVersion = true, bool $patch = false): Listing { $listing = $this->find($id); // Fallback to create if the listing does not exist diff --git a/lib/Db/OrganizationMapper.php b/lib/Db/OrganizationMapper.php index c83a859c..3c605d4c 100644 --- a/lib/Db/OrganizationMapper.php +++ b/lib/Db/OrganizationMapper.php @@ -135,7 +135,7 @@ public function createFromArray(array $object): Organization * * @return Organization The updated Organization entity */ - public function updateFromArray(int $id, array $object, bool $updateVersion = true): Organization + public function updateFromArray(int $id, array $object, bool $updateVersion = true, bool $patch = false): Organization { $organization = $this->find($id); // Fallback to create if the organization does not exist diff --git a/lib/Db/PublicationMapper.php b/lib/Db/PublicationMapper.php index c3ced4f0..56363f96 100644 --- a/lib/Db/PublicationMapper.php +++ b/lib/Db/PublicationMapper.php @@ -224,7 +224,7 @@ public function createFromArray(array $object): Publication * * @return Publication The updated Publication entity */ - public function updateFromArray(int $id, array $object, bool $updateVersion = true): Publication + public function updateFromArray(int $id, array $object, bool $updateVersion = true, bool $patch = false): Publication { $publication = $this->find(id: $id); // Fallback to create if the publication does not exist diff --git a/lib/Db/PublicationTypeMapper.php b/lib/Db/PublicationTypeMapper.php index 7a2cc336..1474130d 100644 --- a/lib/Db/PublicationTypeMapper.php +++ b/lib/Db/PublicationTypeMapper.php @@ -155,7 +155,7 @@ public function createFromArray(array $object): PublicationType * @throws DoesNotExistException If the entity is not found * @throws MultipleObjectsReturnedException|\OCP\DB\Exception If multiple entities are found */ - public function updateFromArray(int $id, array $object, bool $updateVersion = true): PublicationType + public function updateFromArray(int $id, array $object, bool $updateVersion = true, bool $patch = false): PublicationType { $publicationType = $this->find($id); // Fallback to create if the publication type does not exist diff --git a/lib/Db/ThemeMapper.php b/lib/Db/ThemeMapper.php index 272159ea..8b0b239b 100644 --- a/lib/Db/ThemeMapper.php +++ b/lib/Db/ThemeMapper.php @@ -141,7 +141,7 @@ public function createFromArray(array $object): Theme * @throws DoesNotExistException If the entity is not found * @throws MultipleObjectsReturnedException|\OCP\DB\Exception If multiple entities are found */ - public function updateFromArray(int $id, array $object, bool $updateVersion = true): Theme + public function updateFromArray(int $id, array $object, bool $updateVersion = true, bool $patch = false): Theme { $theme = $this->find($id); // Fallback to create if the theme does not exist