From 2534176b8d642cd272e44c8d4e82b314472cb2a6 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 24 Sep 2021 15:51:16 +0300 Subject: [PATCH] renaming --- .../{Helpers => Helper}/UserFinder.php | 14 ++++++-------- .../Espo/Core/Authentication/Logins/ApiKey.php | 2 +- .../Espo/Core/Authentication/Logins/Espo.php | 2 +- .../Espo/Core/Authentication/Logins/Hmac.php | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) rename application/Espo/Core/Authentication/{Helpers => Helper}/UserFinder.php (90%) diff --git a/application/Espo/Core/Authentication/Helpers/UserFinder.php b/application/Espo/Core/Authentication/Helper/UserFinder.php similarity index 90% rename from application/Espo/Core/Authentication/Helpers/UserFinder.php rename to application/Espo/Core/Authentication/Helper/UserFinder.php index 3f4fdd56d1..f29f25ef9e 100644 --- a/application/Espo/Core/Authentication/Helpers/UserFinder.php +++ b/application/Espo/Core/Authentication/Helper/UserFinder.php @@ -27,17 +27,15 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -namespace Espo\Core\Authentication\Helpers; +namespace Espo\Core\Authentication\Helper; -use Espo\Core\{ - ORM\EntityManager, -}; +use Espo\ORM\EntityManager; use Espo\Entities\User; class UserFinder { - protected $entityManager; + private $entityManager; public function __construct(EntityManager $entityManager) { @@ -47,7 +45,7 @@ class UserFinder public function find(string $username, string $hash): ?User { $user = $this->entityManager - ->getRepository('User') + ->getRDBRepository(User::ENTITY_TYPE) ->where([ 'userName' => $username, 'password' => $hash, @@ -61,7 +59,7 @@ class UserFinder public function findApiHmac(string $apiKey): ?User { $user = $this->entityManager - ->getRepository('User') + ->getRDBRepository(User::ENTITY_TYPE) ->where([ 'type' => 'api', 'apiKey' => $apiKey, @@ -75,7 +73,7 @@ class UserFinder public function findApiApiKey(string $apiKey): ?User { $user = $this->entityManager - ->getRepository('User') + ->getRDBRepository(User::ENTITY_TYPE) ->where([ 'type' => 'api', 'apiKey' => $apiKey, diff --git a/application/Espo/Core/Authentication/Logins/ApiKey.php b/application/Espo/Core/Authentication/Logins/ApiKey.php index 96cd6e62e9..262fcbad93 100644 --- a/application/Espo/Core/Authentication/Logins/ApiKey.php +++ b/application/Espo/Core/Authentication/Logins/ApiKey.php @@ -34,7 +34,7 @@ use Espo\Core\{ Authentication\Login, Authentication\Login\Data, Authentication\Result, - Authentication\Helpers\UserFinder, + Authentication\Helper\UserFinder, Authentication\Result\FailReason, }; diff --git a/application/Espo/Core/Authentication/Logins/Espo.php b/application/Espo/Core/Authentication/Logins/Espo.php index f8042df1ef..657e854161 100644 --- a/application/Espo/Core/Authentication/Logins/Espo.php +++ b/application/Espo/Core/Authentication/Logins/Espo.php @@ -35,7 +35,7 @@ use Espo\Core\{ Authentication\Login, Authentication\Login\Data, Authentication\Result, - Authentication\Helpers\UserFinder, + Authentication\Helper\UserFinder, Authentication\Result\FailReason, }; diff --git a/application/Espo/Core/Authentication/Logins/Hmac.php b/application/Espo/Core/Authentication/Logins/Hmac.php index bd5b0e18dd..66f29bc6ab 100644 --- a/application/Espo/Core/Authentication/Logins/Hmac.php +++ b/application/Espo/Core/Authentication/Logins/Hmac.php @@ -35,7 +35,7 @@ use Espo\Core\{ Authentication\Login, Authentication\Login\Data, Authentication\Result, - Authentication\Helpers\UserFinder, + Authentication\Helper\UserFinder, Exceptions\Error, Authentication\Result\FailReason, };