Skip to content

Commit

Permalink
Merge pull request #58 from ConductionNL/fix/old-sync-contract-fields
Browse files Browse the repository at this point in the history
Keep old properties
  • Loading branch information
WilcoLouwerse authored Nov 12, 2024
2 parents 1bbe6b7 + f705cb0 commit 06a1aff
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/Db/SynchronizationContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
*/
class SynchronizationContract extends Entity implements JsonSerializable
{
// @todo can be removed when migrations are merged
protected ?string $sourceId = null; // OLD The id of the object in the source
protected ?string $sourceHash = null; // OLD The hash of the object in the source

protected ?string $uuid = null;
protected ?string $version = null;
protected ?string $synchronizationId = null; // The synchronization that this contract belongs to
Expand Down Expand Up @@ -49,6 +53,10 @@ public function __construct() {
$this->addType('targetLastSynced', 'datetime');
$this->addType('created', 'datetime');
$this->addType('updated', 'datetime');

// @todo can be removed when migrations are merged
$this->addType('sourceId', 'string');
$this->addType('sourceHash', 'string');
}

public function getJsonFields(): array
Expand Down Expand Up @@ -99,7 +107,10 @@ public function jsonSerialize(): array
'targetLastChecked' => isset($this->targetLastChecked) ? $this->targetLastChecked->format('c') : null,
'targetLastSynced' => isset($this->targetLastSynced) ? $this->targetLastSynced->format('c') : null,
'created' => isset($this->created) ? $this->created->format('c') : null,
'updated' => isset($this->updated) ? $this->updated->format('c') : null
'updated' => isset($this->updated) ? $this->updated->format('c') : null,
// @todo these 2 can be removed when migrations are merged
'sourceId' => $this->sourceId,
'sourceHash' => $this->sourceHash
];
}
}

0 comments on commit 06a1aff

Please sign in to comment.