@@ -89,30 +89,30 @@ abstract class AbstractQuery
89
89
/**
90
90
* The user-specified ResultSetMapping to use.
91
91
*/
92
- protected ResultSetMapping |null $ _resultSetMapping = null ;
92
+ protected ResultSetMapping |null $ resultSetMapping = null ;
93
93
94
94
/**
95
95
* The map of query hints.
96
96
*
97
97
* @psalm-var array<string, mixed>
98
98
*/
99
- protected array $ _hints = [];
99
+ protected array $ hints = [];
100
100
101
101
/**
102
102
* The hydration mode.
103
103
*
104
104
* @psalm-var string|AbstractQuery::HYDRATE_*
105
105
*/
106
- protected string |int $ _hydrationMode = self ::HYDRATE_OBJECT ;
106
+ protected string |int $ hydrationMode = self ::HYDRATE_OBJECT ;
107
107
108
- protected QueryCacheProfile |null $ _queryCacheProfile = null ;
108
+ protected QueryCacheProfile |null $ queryCacheProfile = null ;
109
109
110
110
/**
111
111
* Whether or not expire the result cache.
112
112
*/
113
- protected bool $ _expireResultCache = false ;
113
+ protected bool $ expireResultCache = false ;
114
114
115
- protected QueryCacheProfile |null $ _hydrationCacheProfile = null ;
115
+ protected QueryCacheProfile |null $ hydrationCacheProfile = null ;
116
116
117
117
/**
118
118
* Whether to use second level cache, if available.
@@ -147,7 +147,7 @@ public function __construct(
147
147
protected EntityManagerInterface $ em ,
148
148
) {
149
149
$ this ->parameters = new ArrayCollection ();
150
- $ this ->_hints = $ em ->getConfiguration ()->getDefaultQueryHints ();
150
+ $ this ->hints = $ em ->getConfiguration ()->getDefaultQueryHints ();
151
151
$ this ->hasCache = $ this ->em ->getConfiguration ()->isSecondLevelCacheEnabled ();
152
152
153
153
if ($ this ->hasCache ) {
@@ -260,7 +260,7 @@ public function free(): void
260
260
{
261
261
$ this ->parameters = new ArrayCollection ();
262
262
263
- $ this ->_hints = $ this ->em ->getConfiguration ()->getDefaultQueryHints ();
263
+ $ this ->hints = $ this ->em ->getConfiguration ()->getDefaultQueryHints ();
264
264
}
265
265
266
266
/**
@@ -434,7 +434,7 @@ private function processArrayParameterValue(array $value): array
434
434
public function setResultSetMapping (ResultSetMapping $ rsm ): static
435
435
{
436
436
$ this ->translateNamespaces ($ rsm );
437
- $ this ->_resultSetMapping = $ rsm ;
437
+ $ this ->resultSetMapping = $ rsm ;
438
438
439
439
return $ this ;
440
440
}
@@ -444,7 +444,7 @@ public function setResultSetMapping(ResultSetMapping $rsm): static
444
444
*/
445
445
protected function getResultSetMapping (): ResultSetMapping |null
446
446
{
447
- return $ this ->_resultSetMapping ;
447
+ return $ this ->resultSetMapping ;
448
448
}
449
449
450
450
/**
@@ -481,7 +481,7 @@ private function translateNamespaces(ResultSetMapping $rsm): void
481
481
public function setHydrationCacheProfile (QueryCacheProfile |null $ profile ): static
482
482
{
483
483
if ($ profile === null ) {
484
- $ this ->_hydrationCacheProfile = null ;
484
+ $ this ->hydrationCacheProfile = null ;
485
485
486
486
return $ this ;
487
487
}
@@ -493,14 +493,14 @@ public function setHydrationCacheProfile(QueryCacheProfile|null $profile): stati
493
493
}
494
494
}
495
495
496
- $ this ->_hydrationCacheProfile = $ profile ;
496
+ $ this ->hydrationCacheProfile = $ profile ;
497
497
498
498
return $ this ;
499
499
}
500
500
501
501
public function getHydrationCacheProfile (): QueryCacheProfile |null
502
502
{
503
- return $ this ->_hydrationCacheProfile ;
503
+ return $ this ->hydrationCacheProfile ;
504
504
}
505
505
506
506
/**
@@ -514,7 +514,7 @@ public function getHydrationCacheProfile(): QueryCacheProfile|null
514
514
public function setResultCacheProfile (QueryCacheProfile |null $ profile ): static
515
515
{
516
516
if ($ profile === null ) {
517
- $ this ->_queryCacheProfile = null ;
517
+ $ this ->queryCacheProfile = null ;
518
518
519
519
return $ this ;
520
520
}
@@ -526,7 +526,7 @@ public function setResultCacheProfile(QueryCacheProfile|null $profile): static
526
526
}
527
527
}
528
528
529
- $ this ->_queryCacheProfile = $ profile ;
529
+ $ this ->queryCacheProfile = $ profile ;
530
530
531
531
return $ this ;
532
532
}
@@ -537,15 +537,15 @@ public function setResultCacheProfile(QueryCacheProfile|null $profile): static
537
537
public function setResultCache (CacheItemPoolInterface |null $ resultCache ): static
538
538
{
539
539
if ($ resultCache === null ) {
540
- if ($ this ->_queryCacheProfile ) {
541
- $ this ->_queryCacheProfile = new QueryCacheProfile ($ this ->_queryCacheProfile ->getLifetime (), $ this ->_queryCacheProfile ->getCacheKey ());
540
+ if ($ this ->queryCacheProfile ) {
541
+ $ this ->queryCacheProfile = new QueryCacheProfile ($ this ->queryCacheProfile ->getLifetime (), $ this ->queryCacheProfile ->getCacheKey ());
542
542
}
543
543
544
544
return $ this ;
545
545
}
546
546
547
- $ this ->_queryCacheProfile = $ this ->_queryCacheProfile
548
- ? $ this ->_queryCacheProfile ->setResultCache ($ resultCache )
547
+ $ this ->queryCacheProfile = $ this ->queryCacheProfile
548
+ ? $ this ->queryCacheProfile ->setResultCache ($ resultCache )
549
549
: new QueryCacheProfile (0 , null , $ resultCache );
550
550
551
551
return $ this ;
@@ -575,7 +575,7 @@ public function enableResultCache(int|null $lifetime = null, string|null $result
575
575
*/
576
576
public function disableResultCache (): static
577
577
{
578
- $ this ->_queryCacheProfile = null ;
578
+ $ this ->queryCacheProfile = null ;
579
579
580
580
return $ this ;
581
581
}
@@ -591,20 +591,20 @@ public function setResultCacheLifetime(int|null $lifetime): static
591
591
{
592
592
$ lifetime = (int ) $ lifetime ;
593
593
594
- if ($ this ->_queryCacheProfile ) {
595
- $ this ->_queryCacheProfile = $ this ->_queryCacheProfile ->setLifetime ($ lifetime );
594
+ if ($ this ->queryCacheProfile ) {
595
+ $ this ->queryCacheProfile = $ this ->queryCacheProfile ->setLifetime ($ lifetime );
596
596
597
597
return $ this ;
598
598
}
599
599
600
- $ this ->_queryCacheProfile = new QueryCacheProfile ($ lifetime );
600
+ $ this ->queryCacheProfile = new QueryCacheProfile ($ lifetime );
601
601
602
602
$ cache = $ this ->em ->getConfiguration ()->getResultCache ();
603
603
if (! $ cache ) {
604
604
return $ this ;
605
605
}
606
606
607
- $ this ->_queryCacheProfile = $ this ->_queryCacheProfile ->setResultCache ($ cache );
607
+ $ this ->queryCacheProfile = $ this ->queryCacheProfile ->setResultCache ($ cache );
608
608
609
609
return $ this ;
610
610
}
@@ -618,7 +618,7 @@ public function setResultCacheLifetime(int|null $lifetime): static
618
618
*/
619
619
public function expireResultCache (bool $ expire = true ): static
620
620
{
621
- $ this ->_expireResultCache = $ expire ;
621
+ $ this ->expireResultCache = $ expire ;
622
622
623
623
return $ this ;
624
624
}
@@ -628,12 +628,12 @@ public function expireResultCache(bool $expire = true): static
628
628
*/
629
629
public function getExpireResultCache (): bool
630
630
{
631
- return $ this ->_expireResultCache ;
631
+ return $ this ->expireResultCache ;
632
632
}
633
633
634
634
public function getQueryCacheProfile (): QueryCacheProfile |null
635
635
{
636
- return $ this ->_queryCacheProfile ;
636
+ return $ this ->queryCacheProfile ;
637
637
}
638
638
639
639
/**
@@ -644,7 +644,7 @@ public function getQueryCacheProfile(): QueryCacheProfile|null
644
644
*/
645
645
public function setFetchMode (string $ class , string $ assocName , int $ fetchMode ): static
646
646
{
647
- $ this ->_hints ['fetchMode ' ][$ class ][$ assocName ] = $ fetchMode ;
647
+ $ this ->hints ['fetchMode ' ][$ class ][$ assocName ] = $ fetchMode ;
648
648
649
649
return $ this ;
650
650
}
@@ -660,7 +660,7 @@ public function setFetchMode(string $class, string $assocName, int $fetchMode):
660
660
*/
661
661
public function setHydrationMode (string |int $ hydrationMode ): static
662
662
{
663
- $ this ->_hydrationMode = $ hydrationMode ;
663
+ $ this ->hydrationMode = $ hydrationMode ;
664
664
665
665
return $ this ;
666
666
}
@@ -672,7 +672,7 @@ public function setHydrationMode(string|int $hydrationMode): static
672
672
*/
673
673
public function getHydrationMode (): string |int
674
674
{
675
- return $ this ->_hydrationMode ;
675
+ return $ this ->hydrationMode ;
676
676
}
677
677
678
678
/**
@@ -738,7 +738,7 @@ public function getOneOrNullResult(string|int|null $hydrationMode = null): mixed
738
738
return null ;
739
739
}
740
740
741
- if ($ this ->_hydrationMode !== self ::HYDRATE_SINGLE_SCALAR && ! $ result ) {
741
+ if ($ this ->hydrationMode !== self ::HYDRATE_SINGLE_SCALAR && ! $ result ) {
742
742
return null ;
743
743
}
744
744
@@ -770,7 +770,7 @@ public function getSingleResult(string|int|null $hydrationMode = null): mixed
770
770
{
771
771
$ result = $ this ->execute (null , $ hydrationMode );
772
772
773
- if ($ this ->_hydrationMode !== self ::HYDRATE_SINGLE_SCALAR && ! $ result ) {
773
+ if ($ this ->hydrationMode !== self ::HYDRATE_SINGLE_SCALAR && ! $ result ) {
774
774
throw new NoResultException ();
775
775
}
776
776
@@ -805,7 +805,7 @@ public function getSingleScalarResult(): mixed
805
805
*/
806
806
public function setHint (string $ name , mixed $ value ): static
807
807
{
808
- $ this ->_hints [$ name ] = $ value ;
808
+ $ this ->hints [$ name ] = $ value ;
809
809
810
810
return $ this ;
811
811
}
@@ -817,12 +817,12 @@ public function setHint(string $name, mixed $value): static
817
817
*/
818
818
public function getHint (string $ name ): mixed
819
819
{
820
- return $ this ->_hints [$ name ] ?? false ;
820
+ return $ this ->hints [$ name ] ?? false ;
821
821
}
822
822
823
823
public function hasHint (string $ name ): bool
824
824
{
825
- return isset ($ this ->_hints [$ name ]);
825
+ return isset ($ this ->hints [$ name ]);
826
826
}
827
827
828
828
/**
@@ -832,7 +832,7 @@ public function hasHint(string $name): bool
832
832
*/
833
833
public function getHints (): array
834
834
{
835
- return $ this ->_hints ;
835
+ return $ this ->hints ;
836
836
}
837
837
838
838
/**
@@ -867,7 +867,7 @@ public function toIterable(
867
867
868
868
$ stmt = $ this ->_doExecute ();
869
869
870
- return $ this ->em ->newHydrator ($ this ->_hydrationMode )->toIterable ($ stmt , $ rsm , $ this ->_hints );
870
+ return $ this ->em ->newHydrator ($ this ->hydrationMode )->toIterable ($ stmt , $ rsm , $ this ->hints );
871
871
}
872
872
873
873
/**
@@ -908,7 +908,7 @@ private function executeIgnoreQueryCache(
908
908
$ setCacheEntry = static function ($ data ): void {
909
909
};
910
910
911
- if ($ this ->_hydrationCacheProfile !== null ) {
911
+ if ($ this ->hydrationCacheProfile !== null ) {
912
912
[$ cacheKey , $ realCacheKey ] = $ this ->getHydrationCacheId ();
913
913
914
914
$ cache = $ this ->getHydrationCache ();
@@ -941,7 +941,7 @@ private function executeIgnoreQueryCache(
941
941
throw new LogicException ('Uninitialized result set mapping. ' );
942
942
}
943
943
944
- $ data = $ this ->em ->newHydrator ($ this ->_hydrationMode )->hydrateAll ($ stmt , $ rsm , $ this ->_hints );
944
+ $ data = $ this ->em ->newHydrator ($ this ->hydrationMode )->hydrateAll ($ stmt , $ rsm , $ this ->hints );
945
945
946
946
$ setCacheEntry ($ data );
947
947
@@ -950,9 +950,9 @@ private function executeIgnoreQueryCache(
950
950
951
951
private function getHydrationCache (): CacheItemPoolInterface
952
952
{
953
- assert ($ this ->_hydrationCacheProfile !== null );
953
+ assert ($ this ->hydrationCacheProfile !== null );
954
954
955
- $ cache = $ this ->_hydrationCacheProfile ->getResultCache ();
955
+ $ cache = $ this ->hydrationCacheProfile ->getResultCache ();
956
956
assert ($ cache !== null );
957
957
958
958
return $ cache ;
@@ -981,7 +981,7 @@ private function executeUsingQueryCache(
981
981
$ this ->getTimestampKey (),
982
982
);
983
983
984
- $ result = $ queryCache ->get ($ queryKey , $ rsm , $ this ->_hints );
984
+ $ result = $ queryCache ->get ($ queryKey , $ rsm , $ this ->hints );
985
985
986
986
if ($ result !== null ) {
987
987
if ($ this ->cacheLogger ) {
@@ -992,7 +992,7 @@ private function executeUsingQueryCache(
992
992
}
993
993
994
994
$ result = $ this ->executeIgnoreQueryCache ($ parameters , $ hydrationMode );
995
- $ cached = $ queryCache ->put ($ queryKey , $ rsm , $ result , $ this ->_hints );
995
+ $ cached = $ queryCache ->put ($ queryKey , $ rsm , $ result , $ this ->hints );
996
996
997
997
if ($ this ->cacheLogger ) {
998
998
$ this ->cacheLogger ->queryCacheMiss ($ queryCache ->getRegion ()->getName (), $ queryKey );
@@ -1007,8 +1007,8 @@ private function executeUsingQueryCache(
1007
1007
1008
1008
private function getTimestampKey (): TimestampCacheKey |null
1009
1009
{
1010
- assert ($ this ->_resultSetMapping !== null );
1011
- $ entityName = reset ($ this ->_resultSetMapping ->aliasMap );
1010
+ assert ($ this ->resultSetMapping !== null );
1011
+ $ entityName = reset ($ this ->resultSetMapping ->aliasMap );
1012
1012
1013
1013
if (empty ($ entityName )) {
1014
1014
return null ;
@@ -1056,11 +1056,11 @@ protected function getHydrationCacheId(): array
1056
1056
*/
1057
1057
public function setResultCacheId (string |null $ id ): static
1058
1058
{
1059
- if (! $ this ->_queryCacheProfile ) {
1059
+ if (! $ this ->queryCacheProfile ) {
1060
1060
return $ this ->setResultCacheProfile (new QueryCacheProfile (0 , $ id ));
1061
1061
}
1062
1062
1063
- $ this ->_queryCacheProfile = $ this ->_queryCacheProfile ->setCacheKey ($ id );
1063
+ $ this ->queryCacheProfile = $ this ->queryCacheProfile ->setCacheKey ($ id );
1064
1064
1065
1065
return $ this ;
1066
1066
}
@@ -1081,8 +1081,8 @@ public function __clone()
1081
1081
{
1082
1082
$ this ->parameters = new ArrayCollection ();
1083
1083
1084
- $ this ->_hints = [];
1085
- $ this ->_hints = $ this ->em ->getConfiguration ()->getDefaultQueryHints ();
1084
+ $ this ->hints = [];
1085
+ $ this ->hints = $ this ->em ->getConfiguration ()->getDefaultQueryHints ();
1086
1086
}
1087
1087
1088
1088
/**
0 commit comments