Skip to content

Commit 845d14f

Browse files
committed
update note to specify that the incrementing only happens in the same process
1 parent e914cd3 commit 845d14f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

components/uid.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ entity primary keys::
156156
private $id;
157157

158158
// ...
159-
159+
160160
public function getId(): ?Uuid
161161
{
162162
return $this->id;
163163
}
164-
164+
165165
// ...
166166
}
167167

@@ -211,9 +211,10 @@ are encoded as 26-character strings (vs 36-character UUIDs).
211211

212212
.. note::
213213

214-
If you generate more than one ULID during the same millisecond then the random
215-
portion is incremented by one bit in order to provide monotonicity for sorting.
216-
The random portion is **not** random compared to the previous ULID in this case.
214+
If you generate more than one ULID during the same millisecond in the
215+
same process then the random portion is incremented by one bit in order
216+
to provide monotonicity for sorting. The random portion is **not**
217+
random compared to the previous ULID in this case.
217218

218219
Generating ULIDs
219220
~~~~~~~~~~~~~~~~
@@ -292,7 +293,7 @@ There's also a Doctrine generator to help autogenerate ULID values for the
292293
entity primary keys::
293294

294295
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
295-
use Symfony\Component\Uid\Ulid;
296+
use Symfony\Component\Uid\Ulid;
296297

297298
/**
298299
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
@@ -308,14 +309,14 @@ entity primary keys::
308309
private $id;
309310

310311
// ...
311-
312+
312313
public function getId(): ?Ulid
313314
{
314315
return $this->id;
315316
}
316-
317+
317318
// ...
318-
319+
319320
}
320321

321322
.. versionadded:: 5.2

0 commit comments

Comments
 (0)