File tree 3 files changed +22
-5
lines changed
3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ to find out.
15
15
16
16
Use ` Doctrine\ORM\Query\TokenType::T_* ` instead.
17
17
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
+
18
23
# Upgrade to 2.17
19
24
20
25
## Deprecate annotations classes for named queries
Original file line number Diff line number Diff line change @@ -1844,11 +1844,13 @@ public function JoinAssociationDeclaration()
1844
1844
*/
1845
1845
public function PartialObjectExpression ()
1846
1846
{
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
+ }
1852
1854
1853
1855
$ this ->match (TokenType::T_PARTIAL );
1854
1856
Original file line number Diff line number Diff line change 41
41
use Doctrine \ORM \Persisters \Entity \JoinedSubclassPersister ;
42
42
use Doctrine \ORM \Persisters \Entity \SingleTablePersister ;
43
43
use Doctrine \ORM \Proxy \InternalProxy ;
44
+ use Doctrine \ORM \Query \SqlWalker ;
44
45
use Doctrine \ORM \Utility \IdentifierFlattener ;
45
46
use Doctrine \Persistence \Mapping \RuntimeReflectionService ;
46
47
use Doctrine \Persistence \NotifyPropertyChanged ;
@@ -2919,6 +2920,15 @@ private function newInstance(ClassMetadata $class)
2919
2920
*/
2920
2921
public function createEntity ($ className , array $ data , &$ hints = [])
2921
2922
{
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
+
2922
2932
$ class = $ this ->em ->getClassMetadata ($ className );
2923
2933
2924
2934
$ id = $ this ->identifierFlattener ->flattenIdentifier ($ class , $ data );
You can’t perform that action at this time.
0 commit comments