Skip to content

Commit c4286e5

Browse files
committed
As seen in ramsey/uuid#329 fix bug 'Could not convert database value "..." to Doctrine Type uuid_binary_ordered_time. Expected format: UuidV1'
1 parent 1596159 commit c4286e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/UuidBinaryOrderedTimeType.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ private function assertUuidV1(UuidInterface $value)
201201
*/
202202
private function encode(UuidInterface $uuid)
203203
{
204-
$this->assertUuidV1($uuid);
204+
$dec = $this->decode($uuid->getBytes());
205+
206+
$this->assertUuidV1($dec);
205207

206-
return $this->getCodec()->encodeBinary($uuid);
208+
return $this->getCodec()->encodeBinary($dec);
207209
}
208210

209211
/**

0 commit comments

Comments
 (0)