Commit 49c311b
committed
feature #46642 [DoctrineBridge] Add
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 typesNAME const for UID types (marcelsiegert)3 files changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
0 commit comments