Skip to content

Commit

Permalink
Merge pull request #49 from CommonGateway/fix/beheer-2406/no-attachme…
Browse files Browse the repository at this point in the history
…nts-in-mongo

Fetch attachment from Postgresql
  • Loading branch information
rjzondervan authored May 14, 2024
2 parents f3e9f91 + 2225aa5 commit fdc8464
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Service/ZgwToVrijbrpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,19 @@ public function zgwToVrijbrpDocumentHandler(array $data, array $configuration):

$object = $this->entityManager->getRepository('App:ObjectEntity')->find($dataId);

$objectArray = $object->toArray();

$informatieObject = $object->getValue('informatieobject');

// Do mapping with Document ObjectEntity as array.
$objectArray = $this->mappingService->mapping($this->mapping, $object->toArray());
$objectArray = $this->mappingService->mapping($this->mapping, $objectArray);

if($informatieObject->getValueObject('inhoud') !== false && $informatieObject->getValueObject('inhoud')->getFiles()->count() > 0) {

$file = $informatieObject->getValueObject('inhoud')->getFiles()->first();
$objectArray['content'] = $file->getBase64();

}

// todo: make this a switch (in a function?) or something when merging all Vrijbrp Bundles:
$configuration['location'] = $this->configuration['location'].'/'.$objectArray['dossierId'].'/documents';
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require": {
"php": ">=7.4",
"commongateway/corebundle": "^1.1.110 | <2.0",
"common-gateway/zds-to-zgw-bundle": "^0.1 | ^0.2",
"common-gateway/zds-to-zgw-bundle": "^0.1.4 | ^0.2",
"common-gateway/sim-xml-to-zgw-bundle": "^0.0.15 | ^0.1"
},
"require-dev": {
Expand Down

0 comments on commit fdc8464

Please sign in to comment.