Skip to content

Commit

Permalink
Fix UUID keyGen
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Sep 17, 2024
1 parent 6759bae commit a348f89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
34 changes: 0 additions & 34 deletions docker-compose-image.yml

This file was deleted.

6 changes: 4 additions & 2 deletions src/Repository/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ public function save($model, ?UpdateConstraint $updateConstraint = null)

$primaryKey = $this->repository->getMapper()->getPrimaryKey()[0];

if ($model->{"get$primaryKey"}() instanceof Literal) {
$model->{"set$primaryKey"}(HexUuidLiteral::getUuidFromLiteral($model->{"get$primaryKey"}()));
if ($model->{"get$primaryKey"}() instanceof HexUuidLiteral) {
/** @var HexUuidLiteral $literal */
$literal = $model->{"get$primaryKey"}();
$model->{"set$primaryKey"}($literal->formatUuid());
}

return $model;
Expand Down

0 comments on commit a348f89

Please sign in to comment.