Skip to content

Commit 23c786e

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: [Uuid] Add few property types
2 parents 6db5304 + ae9405e commit 23c786e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

components/uid.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,13 @@ type, which converts to/from UUID objects automatically::
236236

237237
use Doctrine\ORM\Mapping as ORM;
238238
use Symfony\Bridge\Doctrine\Types\UuidType;
239+
use Symfony\Component\Uid\Uuid;
239240

240241
#[ORM\Entity(repositoryClass: ProductRepository::class)]
241242
class Product
242243
{
243244
#[ORM\Column(type: UuidType::NAME)]
244-
private $someProperty;
245+
private Uuid $someProperty;
245246

246247
// ...
247248
}
@@ -265,7 +266,7 @@ entity primary keys::
265266
#[ORM\Column(type: UuidType::NAME, unique: true)]
266267
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
267268
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
268-
private $id;
269+
private ?Uuid $id;
269270

270271
public function getId(): ?Uuid
271272
{
@@ -422,12 +423,13 @@ type, which converts to/from ULID objects automatically::
422423

423424
use Doctrine\ORM\Mapping as ORM;
424425
use Symfony\Bridge\Doctrine\Types\UlidType;
426+
use Symfony\Component\Uid\Ulid;
425427

426428
#[ORM\Entity(repositoryClass: ProductRepository::class)]
427429
class Product
428430
{
429431
#[ORM\Column(type: UlidType::NAME)]
430-
private $someProperty;
432+
private Ulid $someProperty;
431433

432434
// ...
433435
}
@@ -451,7 +453,7 @@ entity primary keys::
451453
#[ORM\Column(type: UlidType::NAME, unique: true)]
452454
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
453455
#[ORM\CustomIdGenerator(class: 'doctrine.ulid_generator')]
454-
private $id;
456+
private ?Ulid $id;
455457

456458
public function getId(): ?Ulid
457459
{

0 commit comments

Comments
 (0)