From 5eaec209ac129215d1eaacfa32649ea2055afecd Mon Sep 17 00:00:00 2001 From: Roman Bondarenko <83121880+theuargb@users.noreply.github.com> Date: Wed, 1 Jun 2022 10:22:45 +0300 Subject: [PATCH 1/2] fix: repo item type fqdn if namespace equals --- .../RepositorySourceType/RepositorySourceFactory.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php b/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php index bcf5d1be..fa48264f 100644 --- a/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php +++ b/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php @@ -52,6 +52,14 @@ public function getRepositoryEntityType(string $sourceConfig): string $method = $this->getSourceRepoMethod($sourceConfig); $resultType = $this->reflectionMethodsMap->getMethodReturnType($class, $method); $resultItemsType = $this->reflectionMethodsMap->getMethodReturnType($resultType, 'getItems'); + + $resultItemsType = $this->reflectionMethodsMap->getMethodReturnType($resultType, 'getItems'); + if (strpos($resultItemsType, "\\") === false) { + $typeData = explode("\\", $resultType); + unset($typeData[count($typeData) - 1]); + + $resultItemsType = join("\\", $typeData) . "\\$resultItemsType"; + } return substr($resultItemsType, -2) === '[]' ? substr($resultItemsType, 0, -2) From 84fd83e0511550b835ea03851cc4a5da9cf6145d Mon Sep 17 00:00:00 2001 From: Roman Bondarenko <83121880+theuargb@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:58:25 +0300 Subject: [PATCH 2/2] fix: duplicate on repo item type resolving --- .../RepositorySourceType/RepositorySourceFactory.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php b/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php index fa48264f..a9aee29d 100644 --- a/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php +++ b/Model/GridSourceType/RepositorySourceType/RepositorySourceFactory.php @@ -51,7 +51,6 @@ public function getRepositoryEntityType(string $sourceConfig): string $class = $this->getSourceRepoClass($sourceConfig); $method = $this->getSourceRepoMethod($sourceConfig); $resultType = $this->reflectionMethodsMap->getMethodReturnType($class, $method); - $resultItemsType = $this->reflectionMethodsMap->getMethodReturnType($resultType, 'getItems'); $resultItemsType = $this->reflectionMethodsMap->getMethodReturnType($resultType, 'getItems'); if (strpos($resultItemsType, "\\") === false) {