Skip to content

Commit

Permalink
Add ID to exposed data
Browse files Browse the repository at this point in the history
  • Loading branch information
vvoleman committed Dec 7, 2023
1 parent cd99992 commit 33b91f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Entity/NRPZS/HealthcareService.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public function setFacility(?HealthcareFacility $facility): HealthcareService
public function serialize( ): array
{
return [
'id' => $this->id,
'careField' => $this->careField,
'careForm' => $this->careForm,
'careType' => $this->careType,
Expand Down
4 changes: 3 additions & 1 deletion src/Service/NRPZs/Syncers/HealthcareServiceSyncer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ protected function getRepository(): EntityRepository
*/
protected function handleRow(array $row, EntityRepository $repository): void
{
$id = $row['ZdravotnickeZarizeniId']. '-' . md5($row['OborPece']);

$id = hash('sha256',$row['ZdravotnickeZarizeniId'].$row['OborPece']);
$id = substr($id, 0, 16);
$service = $repository->find($id);

if ($service === null) {
Expand Down

0 comments on commit 33b91f8

Please sign in to comment.