2626 */
2727trait RepositoryMethodsTrait
2828{
29- /**
30- * @psalm-param LockMode::*|null $lockMode
31- */
32- public function find (string $ id , ?int $ lockMode = null , ?int $ lockVersion = null ): ?EntityInterface
29+ public function find (string $ id , LockMode |int |null $ lockMode = null , ?int $ lockVersion = null ): ?EntityInterface
3330 {
3431 $ output = $ this ->getEntityManager ()->find ($ this ->getEntityName (), $ id , $ lockMode , $ lockVersion );
3532
@@ -39,7 +36,7 @@ public function find(string $id, ?int $lockMode = null, ?int $lockVersion = null
3936 /**
4037 * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode
4138 */
42- public function findAdvanced (string $ id , string | int | null $ hydrationMode = null ): null | array | EntityInterface
39+ public function findAdvanced (string $ id , string | int | null $ hydrationMode = null ): null | array | EntityInterface
4340 {
4441 // Get query builder
4542 $ queryBuilder = $ this ->getQueryBuilder ();
@@ -62,9 +59,7 @@ public function findAdvanced(string $id, string | int | null $hydrationMode = nu
6259
6360 public function findOneBy (array $ criteria , ?array $ orderBy = null ): ?object
6461 {
65- $ repository = $ this ->getEntityManager ()->getRepository ($ this ->getEntityName ());
66-
67- return $ repository ->findOneBy ($ criteria , $ orderBy );
62+ return $ this ->getEntityManager ()->getRepository ($ this ->getEntityName ())->findOneBy ($ criteria , $ orderBy );
6863 }
6964
7065 /**
@@ -90,7 +85,7 @@ public function findByAdvanced(
9085 ?array $ orderBy = null ,
9186 ?int $ limit = null ,
9287 ?int $ offset = null ,
93- ?array $ search = null
88+ ?array $ search = null ,
9489 ): array {
9590 // Get query builder
9691 $ queryBuilder = $ this ->getQueryBuilder ($ criteria , $ search , $ orderBy , $ limit , $ offset );
@@ -200,7 +195,7 @@ private function getQueryBuilder(
200195 ?array $ search = null ,
201196 ?array $ orderBy = null ,
202197 ?int $ limit = null ,
203- ?int $ offset = null
198+ ?int $ offset = null ,
204199 ): QueryBuilder {
205200 // Create new QueryBuilder for this instance
206201 $ queryBuilder = $ this ->createQueryBuilder ();
0 commit comments