You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #46642 [DoctrineBridge] Add NAME const for UID types (marcelsiegert)
This PR was merged into the 6.2 branch.
Discussion
----------
[DoctrineBridge] Add `NAME` const for UID types
| Q | A
| ------------- | ---
| Branch? | 6.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR | symfony/symfony-docs#16866
This allows to refer to the constant instead of an "arbitrary" string. For example:
```php
#[ORM\Column(type: UuidType::NAME)]
private $foo;
```
Doctrine [already does it this way][1] in its documentation.
The name of the constant is taken from the already existing `Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineFooType` class, where a constant with a similar purpose already exists (albeit this one is `private`). Another possibility would be `UlidType::ULID` and `UuidType::UUID` as shown in Doctrine's [Custom Mapping Types][2] documentation.
[1]: https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/reference/basic-mapping.html
[2]: https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/cookbook/custom-mapping-types.html
Commits
-------
0273fde6a5 [DoctrineBridge] Add `NAME` const for UID types
0 commit comments