Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Controller/AccruingAmountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use OCA\Dossiq\Service\Money\AmountObjectionService;
use OCA\Dossiq\Service\SettingsService;
use OCA\Dossiq\Service\Support\OwningCaseResolver;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -174,7 +175,7 @@ public function show(string $id): JSONResponse {
}

try {
$row = $objectService->find($id, register: $register, schema: $schema);
$row = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema));
} catch (Throwable $e) {
return new JSONResponse(['message' => 'Not found'], Http::STATUS_NOT_FOUND);
}
Expand Down
7 changes: 3 additions & 4 deletions lib/Controller/BrcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use OCA\Dossiq\Service\ZgwService;
use OCA\Dossiq\Service\Zgw\BrcCrossRegisterSync;
use OCA\Dossiq\Service\Zgw\BrcDocumentLinkHandler;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -360,8 +361,7 @@ public function audittrailIndex(string $resource, string $uuid): JSONResponse {
try {
$objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
} catch (\Throwable $e) {
return new JSONResponse(
Expand Down Expand Up @@ -459,8 +459,7 @@ private function destroyDecision(string $uuid): JSONResponse {
try {
$existingObj = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
} catch (\Throwable $e) {
return $this->zgwService->storeFailureResponse(error: $e, operation: 'BRC delete besluit', object: $object);
Expand Down
45 changes: 16 additions & 29 deletions lib/Controller/DrcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use OCA\Dossiq\Service\ZgwService;
use OCA\Dossiq\Service\Zgw\ZgwRuleResults;
use OCA\Dossiq\Service\Zgw\ZgwSearchScope;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\DataDownloadResponse;
Expand Down Expand Up @@ -748,8 +749,7 @@ private function isReadableEio(string $uuid): bool {
try {
$this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
return true;
} catch (\Throwable $e) {
Expand Down Expand Up @@ -794,9 +794,8 @@ public function download(string $uuid): DataDownloadResponse|JSONResponse {

try {
$object = $this->zgwService->getObjectService()->find(
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema'],
id: $uuid
id: $uuid,
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$objectData = $this->objectToArray(row: $object);

Expand Down Expand Up @@ -925,8 +924,7 @@ private function lockFallback(object $objectService, string $uuid, \Throwable $o
try {
$existing = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->objectToArray(row: $existing);

Expand Down Expand Up @@ -1086,8 +1084,7 @@ private function unlockFallback(object $objectService, string $uuid, \Throwable
try {
$existing = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->objectToArray(row: $existing);

Expand Down Expand Up @@ -1150,8 +1147,7 @@ public function audittrailIndex(string $resource, string $uuid): JSONResponse {
try {
$this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
} catch (\Throwable $e) {
return new JSONResponse(
Expand Down Expand Up @@ -1425,8 +1421,7 @@ private function getGebruiksrechtData(string $uuid): ?array {
try {
$obj = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$data = $this->objectToArray(row: $obj);

Expand Down Expand Up @@ -1496,8 +1491,7 @@ private function checkAndClearIndicationGebruiksrecht(string $eioUuid): void {
try {
$eioObj = $objectService->find(
$eioUuid,
register: $eioConfig['sourceRegister'],
schema: $eioConfig['sourceSchema']
options: new ObjectFindOptions(register: $eioConfig['sourceRegister'], schema: $eioConfig['sourceSchema'])
);
$eioData = $this->objectToArray(row: $eioObj);

Expand Down Expand Up @@ -1551,8 +1545,7 @@ private function setIndicationGebruiksrecht(string $ioUrl, ?bool $value): void {
try {
$eioObj = $objectService->find(
$ioMatches[1],
register: $eioConfig['sourceRegister'],
schema: $eioConfig['sourceSchema']
options: new ObjectFindOptions(register: $eioConfig['sourceRegister'], schema: $eioConfig['sourceSchema'])
);
$eioData = $this->objectToArray(row: $eioObj);

Expand Down Expand Up @@ -1612,8 +1605,7 @@ public function uploadChunk(string $uuid): JSONResponse {
// Find the EIO object.
$existing = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$objectData = $this->objectToArray(row: $existing);

Expand Down Expand Up @@ -1784,8 +1776,7 @@ private function enrichWithBestandsdelen(JSONResponse $response, string $uuid):
try {
$existing = $this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$objectData = $this->objectToArray(row: $existing);

Expand Down Expand Up @@ -2010,8 +2001,7 @@ private function saveEioKeepingItsLock(string $uuid, array $englishData, array $
$existingData = $this->objectToArray(
row: $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
)
);

Expand Down Expand Up @@ -2187,8 +2177,7 @@ private function lockIdFromObject(object $objectService, array $mappingConfig, s
$existingData = $this->objectToArray(
row: $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
)
);
} catch (\Throwable $e) {
Expand Down Expand Up @@ -2229,8 +2218,7 @@ private function storeLockIdInData(
try {
$existing = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->objectToArray(row: $existing);

Expand Down Expand Up @@ -2268,8 +2256,7 @@ private function clearLockIdInData(
try {
$existing = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->objectToArray(row: $existing);

Expand Down
6 changes: 2 additions & 4 deletions lib/Controller/PublicCaseSurvivorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

use OCA\Dossiq\Service\CaseMergeService;
use OCA\Dossiq\Service\SettingsService;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
Expand Down Expand Up @@ -176,10 +177,7 @@ private function renderPublicly(string $caseId): ?array {
try {
$entity = $objectService->find(
id: $caseId,
_extend: [],
files: false,
register: $register,
schema: $schema,
options: new ObjectFindOptions(register: $register, schema: $schema),
_rbac: true,
_multitenancy: true
);
Expand Down
5 changes: 3 additions & 2 deletions lib/Controller/RoutingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use OCA\Dossiq\Service\RoleResolverService;
use OCA\Dossiq\Service\Routing\CaseRouter;
use OCA\Dossiq\Service\SettingsService;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -128,12 +129,12 @@ public function reroute(string $id): JSONResponse {
$caseSchema = $this->settingsService->getConfigValue('case_schema');
$workflowSlug = $this->settingsService->getConfigValue('workflow_template_schema');

$case = $this->toArray(value: $objectService->find($id, register: $register, schema: $caseSchema));
$case = $this->toArray(value: $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $caseSchema)));

$workflowId = (string)($case['workflowTemplate'] ?? '');
$steps = [];
if ($workflowId !== '' && $workflowSlug !== '') {
$workflow = $this->toArray(value: $objectService->find($workflowId, register: $register, schema: $workflowSlug));
$workflow = $this->toArray(value: $objectService->find($workflowId, options: new ObjectFindOptions(register: $register, schema: $workflowSlug)));
$steps = $this->decodeSteps(value: $workflow['steps'] ?? '[]');
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Controller/SubsidieRegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use OCA\Dossiq\AppInfo\Application;
use OCA\Dossiq\Service\SettingsService;
use OCA\Dossiq\Service\Subsidie\SubsidieRegisterExporter;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -172,7 +173,7 @@ private function resolveRegisterConfig(): ?array {
*/
private function safeFind(object $objectService, string $register, string $schema, string $id): array {
try {
$found = $objectService->find($id, register: $register, schema: $schema);
$found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema));
return $this->toArray(value: $found);
} catch (Throwable $e) {
return [];
Expand Down
16 changes: 6 additions & 10 deletions lib/Controller/ZrcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
use OCA\Dossiq\Service\Zgw\ZgwSearchScope;
use OCA\Dossiq\Service\Zgw\ZrcStatusEffects;
use OCA\OpenRegister\Exception\HookStoppedException;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -958,8 +959,7 @@ private function checkCaseReadAccess(string $uuid): ?JSONResponse {
$caseData = $this->objectToArray(
row: $this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
)
);
$caseVa = $caseData['confidentiality'] ?? ($caseData['vertrouwelijkheidaanduiding'] ?? 'openbaar');
Expand Down Expand Up @@ -1219,8 +1219,7 @@ private function preValidateProductenOfDiensten(
try {
$ztObj = $this->zgwService->getObjectService()->find(
$matches[1],
register: $ztConfig['sourceRegister'],
schema: $ztConfig['sourceSchema']
options: new ObjectFindOptions(register: $ztConfig['sourceRegister'], schema: $ztConfig['sourceSchema'])
);
$ztData = $this->objectToArray(row: $ztObj);
} catch (\Throwable $e) {
Expand Down Expand Up @@ -1353,8 +1352,7 @@ private function caseDeleteRefusal(string $uuid): ?JSONResponse {
try {
$caseObj = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
} catch (\Throwable $e) {
$caseObj = null;
Expand Down Expand Up @@ -1530,8 +1528,7 @@ private function resolveCaseClosedForExisting(string $resource, string $uuid): a
try {
$existingObj = $this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->objectToArray(row: $existingObj);

Expand Down Expand Up @@ -1856,8 +1853,7 @@ private function getZioDataForOioSync(string $uuid): ?array {

$zioObj = $this->zgwService->getObjectService()->find(
$uuid,
register: $zioConfig['sourceRegister'],
schema: $zioConfig['sourceSchema']
options: new ObjectFindOptions(register: $zioConfig['sourceRegister'], schema: $zioConfig['sourceSchema'])
);
$zioData = $this->objectToArray(row: $zioObj);

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ZtcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use OCA\Dossiq\Service\Zgw\ZtcTypeNameResolver;
use OCA\Dossiq\Service\Zgw\ZtcUrlValidityFilter;
use OCA\Dossiq\Service\ZgwService;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -285,8 +286,7 @@ private function resolveParentDraft(string $resource, string $uuid): ?bool {
try {
$existingObj = $this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->objectToArray(row: $existingObj);

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ZtcPublishController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
namespace OCA\Dossiq\Controller;

use OCA\Dossiq\Service\ZgwService;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -94,8 +95,7 @@ private function handlePublish(string $resource, string $uuid): JSONResponse {
try {
$existing = $this->zgwService->getObjectService()->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema'])
);
$existingData = $this->publishedCopy(existingData: $this->objectToArray(row: $existing));

Expand Down
3 changes: 2 additions & 1 deletion lib/Flow/DossiqEnsureCommitteeNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

use OCA\Dossiq\Service\Bezwaar\CommitteeDelegationService;
use OCA\Dossiq\Service\SettingsService;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCA\OpenRegister\Service\Flow\IFlowNode;
use OCP\IL10N;
use OCP\WorkflowEngine\IManager;
Expand Down Expand Up @@ -283,7 +284,7 @@ private function loadCommittee(string $committeeId): array {
}

try {
$committee = $objectService->find($committeeId, register: $register, schema: $schema);
$committee = $objectService->find($committeeId, options: new ObjectFindOptions(register: $register, schema: $schema));
} catch (Throwable $e) {
throw new RuntimeException('Could not read committee ' . $committeeId . ': ' . $e->getMessage(), 0, $e);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Listener/DeliveryConcludedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use OCA\Dossiq\Service\SettingsService;
use OCA\Dossiq\Service\ServiceAccount\BackgroundServiceAccount;
use OCA\Dossiq\Service\ServiceAccount\ServiceAccountUnavailableException;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -252,7 +253,7 @@ private function publicationsWith(array $case, ConcludedDelivery $delivery): ?ar
* @return array<string, mixed>|null The case data, or null when not found.
*/
private function loadCase(object $objectService, string $caseId, mixed $register, mixed $schema): ?array {
$obj = $objectService->find(id: $caseId, register: $register, schema: $schema);
$obj = $objectService->find(id: $caseId, options: new ObjectFindOptions(register: $register, schema: $schema));
if ($obj === null) {
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Portal/ApplicantPortalActs.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
use OCA\Dossiq\Service\SettingsService;
use OCA\Dossiq\Service\Timeline\CaseTimeline;
use OCA\Dossiq\Service\Timeline\TimelineKinds;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\Notification\IManager as INotificationManager;
use Psr\Log\LoggerInterface;

Expand Down Expand Up @@ -263,7 +264,7 @@ private function case(string $caseId): ?array {
return null;
}

$object = $objectService->find($caseId, register: $register, schema: $schema);
$object = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema));
if (is_object($object) === false || method_exists($object, 'jsonSerialize') === false) {
return null;
}
Expand Down
Loading
Loading