File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed
Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ to find out.
1515
1616Use ` Doctrine\ORM\Query\TokenType::T_* ` instead.
1717
18+ ## PARTIAL DQL syntax is undeprecated for non-object hydration
19+
20+ Use of the PARTIAL keyword is not deprecated anymore in DQL when used with a hydrator
21+ that is not creating entities, such as the ArrayHydrator.
22+
1823# Upgrade to 2.17
1924
2025## Deprecate annotations classes for named queries
Original file line number Diff line number Diff line change @@ -1844,11 +1844,13 @@ public function JoinAssociationDeclaration()
18441844 */
18451845 public function PartialObjectExpression ()
18461846 {
1847- Deprecation::trigger (
1848- 'doctrine/orm ' ,
1849- 'https://github.com/doctrine/orm/issues/8471 ' ,
1850- 'PARTIAL syntax in DQL is deprecated. '
1851- );
1847+ if ($ this ->query ->getHydrationMode () === Query::HYDRATE_OBJECT ) {
1848+ Deprecation::trigger (
1849+ 'doctrine/orm ' ,
1850+ 'https://github.com/doctrine/orm/issues/8471 ' ,
1851+ 'PARTIAL syntax in DQL is deprecated for object hydration. '
1852+ );
1853+ }
18521854
18531855 $ this ->match (TokenType::T_PARTIAL );
18541856
Original file line number Diff line number Diff line change 4141use Doctrine \ORM \Persisters \Entity \JoinedSubclassPersister ;
4242use Doctrine \ORM \Persisters \Entity \SingleTablePersister ;
4343use Doctrine \ORM \Proxy \InternalProxy ;
44+ use Doctrine \ORM \Query \SqlWalker ;
4445use Doctrine \ORM \Utility \IdentifierFlattener ;
4546use Doctrine \Persistence \Mapping \RuntimeReflectionService ;
4647use Doctrine \Persistence \NotifyPropertyChanged ;
@@ -2919,6 +2920,15 @@ private function newInstance(ClassMetadata $class)
29192920 */
29202921 public function createEntity ($ className , array $ data , &$ hints = [])
29212922 {
2923+ if (isset ($ hints [SqlWalker::HINT_PARTIAL ])) {
2924+ Deprecation::trigger (
2925+ 'doctrine/orm ' ,
2926+ 'https://github.com/doctrine/orm/issues/8471 ' ,
2927+ 'Partial Objects are deprecated for object hydration (here entity %s) ' ,
2928+ $ className
2929+ );
2930+ }
2931+
29222932 $ class = $ this ->em ->getClassMetadata ($ className );
29232933
29242934 $ id = $ this ->identifierFlattener ->flattenIdentifier ($ class , $ data );
You can’t perform that action at this time.
0 commit comments