Skip to content

Commit 90469f5

Browse files
Tofandelderrabus
andauthored
Document alternative to Type::getName (#6077)
Co-authored-by: Alexander M. Turek <[email protected]>
1 parent f5550bb commit 90469f5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

UPGRADE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,11 +679,13 @@ This method is unused by the DBAL since 2.0.
679679

680680
## Deprecated `Type::getName()`
681681

682-
This will method is not useful for the DBAL anymore, and will be removed in 4.0.
682+
This method is not useful for the DBAL anymore, and will be removed in 4.0.
683683
As a consequence, depending on the name of a type being `json` for `jsonb` to
684684
be used for the Postgres platform is deprecated in favor of extending
685685
`Doctrine\DBAL\Types\JsonType`.
686686

687+
You can use `Type::getTypeRegistry()->lookupName($type)` instead.
688+
687689
## Deprecated `AbstractPlatform::getColumnComment()`, `AbstractPlatform::getDoctrineTypeComment()`,
688690
`AbstractPlatform::hasNative*Type()` and `Type::requiresSQLCommentHint()`
689691

src/Types/Type.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ abstract public function getSQLDeclaration(array $column, AbstractPlatform $plat
100100
/**
101101
* Gets the name of this type.
102102
*
103-
* @deprecated this method will be removed in Doctrine DBAL 4.0.
103+
* @deprecated this method will be removed in Doctrine DBAL 4.0,
104+
* use {@see TypeRegistry::lookupName()} instead.
104105
*
105106
* @return string
106107
*/

0 commit comments

Comments
 (0)