Skip to content

[Uuid] Add few property types #18355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions components/uid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,13 @@ type, which converts to/from UUID objects automatically::

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;

#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
#[ORM\Column(type: UuidType::NAME)]
private $someProperty;
private Uuid $someProperty;

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

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

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UlidType;
use Symfony\Component\Uid\Ulid;

#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
#[ORM\Column(type: UlidType::NAME)]
private $someProperty;
private Ulid $someProperty;

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

public function getId(): ?Ulid
{
Expand Down