@@ -56,25 +56,25 @@ protected function prepare()
5656 $ this ->_hints [UnitOfWork::HINT_DEFEREAGERLOAD ] = true ;
5757 }
5858
59- foreach ($ this ->_rsm ->aliasMap as $ dqlAlias => $ className ) {
59+ foreach ($ this ->resultSetMapping () ->aliasMap as $ dqlAlias => $ className ) {
6060 $ this ->identifierMap [$ dqlAlias ] = [];
6161 $ this ->idTemplate [$ dqlAlias ] = '' ;
6262
6363 // Remember which associations are "fetch joined", so that we know where to inject
6464 // collection stubs or proxies and where not.
65- if (! isset ($ this ->_rsm ->relationMap [$ dqlAlias ])) {
65+ if (! isset ($ this ->resultSetMapping () ->relationMap [$ dqlAlias ])) {
6666 continue ;
6767 }
6868
69- $ parent = $ this ->_rsm ->parentAliasMap [$ dqlAlias ];
69+ $ parent = $ this ->resultSetMapping () ->parentAliasMap [$ dqlAlias ];
7070
71- if (! isset ($ this ->_rsm ->aliasMap [$ parent ])) {
71+ if (! isset ($ this ->resultSetMapping () ->aliasMap [$ parent ])) {
7272 throw HydrationException::parentObjectOfRelationNotFound ($ dqlAlias , $ parent );
7373 }
7474
75- $ sourceClassName = $ this ->_rsm ->aliasMap [$ parent ];
75+ $ sourceClassName = $ this ->resultSetMapping () ->aliasMap [$ parent ];
7676 $ sourceClass = $ this ->getClassMetadata ($ sourceClassName );
77- $ assoc = $ sourceClass ->associationMappings [$ this ->_rsm ->relationMap [$ dqlAlias ]];
77+ $ assoc = $ sourceClass ->associationMappings [$ this ->resultSetMapping () ->relationMap [$ dqlAlias ]];
7878
7979 $ this ->_hints ['fetched ' ][$ parent ][$ assoc ['fieldName ' ]] = true ;
8080
@@ -139,7 +139,7 @@ protected function hydrateAllData()
139139 {
140140 $ result = [];
141141
142- while ($ row = $ this ->_stmt ->fetchAssociative ()) {
142+ while ($ row = $ this ->statement () ->fetchAssociative ()) {
143143 $ this ->hydrateRowData ($ row , $ result );
144144 }
145145
@@ -215,16 +215,16 @@ private function initRelatedCollection(
215215 */
216216 private function getEntity (array $ data , string $ dqlAlias )
217217 {
218- $ className = $ this ->_rsm ->aliasMap [$ dqlAlias ];
218+ $ className = $ this ->resultSetMapping () ->aliasMap [$ dqlAlias ];
219219
220- if (isset ($ this ->_rsm ->discriminatorColumns [$ dqlAlias ])) {
221- $ fieldName = $ this ->_rsm ->discriminatorColumns [$ dqlAlias ];
220+ if (isset ($ this ->resultSetMapping () ->discriminatorColumns [$ dqlAlias ])) {
221+ $ fieldName = $ this ->resultSetMapping () ->discriminatorColumns [$ dqlAlias ];
222222
223- if (! isset ($ this ->_rsm ->metaMappings [$ fieldName ])) {
223+ if (! isset ($ this ->resultSetMapping () ->metaMappings [$ fieldName ])) {
224224 throw HydrationException::missingDiscriminatorMetaMappingColumn ($ className , $ fieldName , $ dqlAlias );
225225 }
226226
227- $ discrColumn = $ this ->_rsm ->metaMappings [$ fieldName ];
227+ $ discrColumn = $ this ->resultSetMapping () ->metaMappings [$ fieldName ];
228228
229229 if (! isset ($ data [$ discrColumn ])) {
230230 throw HydrationException::missingDiscriminatorColumn ($ className , $ discrColumn , $ dqlAlias );
@@ -318,12 +318,12 @@ protected function hydrateRowData(array $row, array &$result)
318318
319319 // Hydrate the data chunks
320320 foreach ($ rowData ['data ' ] as $ dqlAlias => $ data ) {
321- $ entityName = $ this ->_rsm ->aliasMap [$ dqlAlias ];
321+ $ entityName = $ this ->resultSetMapping () ->aliasMap [$ dqlAlias ];
322322
323- if (isset ($ this ->_rsm ->parentAliasMap [$ dqlAlias ])) {
323+ if (isset ($ this ->resultSetMapping () ->parentAliasMap [$ dqlAlias ])) {
324324 // It's a joined result
325325
326- $ parentAlias = $ this ->_rsm ->parentAliasMap [$ dqlAlias ];
326+ $ parentAlias = $ this ->resultSetMapping () ->parentAliasMap [$ dqlAlias ];
327327 // we need the $path to save into the identifier map which entities were already
328328 // seen for this parent-child relationship
329329 $ path = $ parentAlias . '. ' . $ dqlAlias ;
@@ -334,13 +334,13 @@ protected function hydrateRowData(array $row, array &$result)
334334 continue ;
335335 }
336336
337- $ parentClass = $ this ->_metadataCache [$ this ->_rsm ->aliasMap [$ parentAlias ]];
338- $ relationField = $ this ->_rsm ->relationMap [$ dqlAlias ];
337+ $ parentClass = $ this ->_metadataCache [$ this ->resultSetMapping () ->aliasMap [$ parentAlias ]];
338+ $ relationField = $ this ->resultSetMapping () ->relationMap [$ dqlAlias ];
339339 $ relation = $ parentClass ->associationMappings [$ relationField ];
340340 $ reflField = $ parentClass ->reflFields [$ relationField ];
341341
342342 // Get a reference to the parent object to which the joined element belongs.
343- if ($ this ->_rsm ->isMixed && isset ($ this ->rootAliases [$ parentAlias ])) {
343+ if ($ this ->resultSetMapping () ->isMixed && isset ($ this ->rootAliases [$ parentAlias ])) {
344344 $ objectClass = $ this ->resultPointers [$ parentAlias ];
345345 $ parentObject = $ objectClass [key ($ objectClass )];
346346 } elseif (isset ($ this ->resultPointers [$ parentAlias ])) {
@@ -389,8 +389,8 @@ protected function hydrateRowData(array $row, array &$result)
389389 } else {
390390 $ element = $ this ->getEntity ($ data , $ dqlAlias );
391391
392- if (isset ($ this ->_rsm ->indexByMap [$ dqlAlias ])) {
393- $ indexValue = $ row [$ this ->_rsm ->indexByMap [$ dqlAlias ]];
392+ if (isset ($ this ->resultSetMapping () ->indexByMap [$ dqlAlias ])) {
393+ $ indexValue = $ row [$ this ->resultSetMapping () ->indexByMap [$ dqlAlias ]];
394394 $ reflFieldValue ->hydrateSet ($ indexValue , $ element );
395395 $ this ->identifierMap [$ path ][$ id [$ parentAlias ]][$ id [$ dqlAlias ]] = $ indexValue ;
396396 } else {
@@ -458,11 +458,11 @@ protected function hydrateRowData(array $row, array &$result)
458458 } else {
459459 // PATH C: Its a root result element
460460 $ this ->rootAliases [$ dqlAlias ] = true ; // Mark as root alias
461- $ entityKey = $ this ->_rsm ->entityMappings [$ dqlAlias ] ?: 0 ;
461+ $ entityKey = $ this ->resultSetMapping () ->entityMappings [$ dqlAlias ] ?: 0 ;
462462
463463 // if this row has a NULL value for the root result id then make it a null result.
464464 if (! isset ($ nonemptyComponents [$ dqlAlias ])) {
465- if ($ this ->_rsm ->isMixed ) {
465+ if ($ this ->resultSetMapping () ->isMixed ) {
466466 $ result [] = [$ entityKey => null ];
467467 } else {
468468 $ result [] = null ;
@@ -477,12 +477,12 @@ protected function hydrateRowData(array $row, array &$result)
477477 if (! isset ($ this ->identifierMap [$ dqlAlias ][$ id [$ dqlAlias ]])) {
478478 $ element = $ this ->getEntity ($ data , $ dqlAlias );
479479
480- if ($ this ->_rsm ->isMixed ) {
480+ if ($ this ->resultSetMapping () ->isMixed ) {
481481 $ element = [$ entityKey => $ element ];
482482 }
483483
484- if (isset ($ this ->_rsm ->indexByMap [$ dqlAlias ])) {
485- $ resultKey = $ row [$ this ->_rsm ->indexByMap [$ dqlAlias ]];
484+ if (isset ($ this ->resultSetMapping () ->indexByMap [$ dqlAlias ])) {
485+ $ resultKey = $ row [$ this ->resultSetMapping () ->indexByMap [$ dqlAlias ]];
486486
487487 if (isset ($ this ->_hints ['collection ' ])) {
488488 $ this ->_hints ['collection ' ]->hydrateSet ($ resultKey , $ element );
@@ -524,8 +524,8 @@ protected function hydrateRowData(array $row, array &$result)
524524 // Append scalar values to mixed result sets
525525 if (isset ($ rowData ['scalars ' ])) {
526526 if (! isset ($ resultKey )) {
527- $ resultKey = isset ($ this ->_rsm ->indexByMap ['scalars ' ])
528- ? $ row [$ this ->_rsm ->indexByMap ['scalars ' ]]
527+ $ resultKey = isset ($ this ->resultSetMapping () ->indexByMap ['scalars ' ])
528+ ? $ row [$ this ->resultSetMapping () ->indexByMap ['scalars ' ]]
529529 : $ this ->resultCounter - 1 ;
530530 }
531531
0 commit comments