diff --git a/src/Api/CmsDashboardEndpoint.php b/src/Api/CmsDashboardEndpoint.php index 39f5406..4d2bc55 100644 --- a/src/Api/CmsDashboardEndpoint.php +++ b/src/Api/CmsDashboardEndpoint.php @@ -26,7 +26,7 @@ public function __construct( public function actionFeed(): void { /** @var AnnouncementRepository $repository */ - $repository = $this->entityManager->getRepository(AnnouncementRepository::class); + $repository = $this->entityManager->getRepository(Announcement::class); $this->sendJson( [ diff --git a/src/Api/CmsEndpoint.php b/src/Api/CmsEndpoint.php index 2f2fbd4..dff66e3 100644 --- a/src/Api/CmsEndpoint.php +++ b/src/Api/CmsEndpoint.php @@ -204,7 +204,7 @@ public function postReportProblem(string $locale, string $description, string $u public function postForgotPasswordSetNew(string $token, string $locale, string $password): void { /** @var UserResetPasswordRequestRepository $repository */ - $repository = $this->entityManager->getRepository(UserResetPasswordRequestRepository::class); + $repository = $this->entityManager->getRepository(UserResetPasswordRequest::class); try { $request = $repository->getByToken($token); diff --git a/src/Api/UserEndpoint.php b/src/Api/UserEndpoint.php index 1473c4f..1d394d9 100644 --- a/src/Api/UserEndpoint.php +++ b/src/Api/UserEndpoint.php @@ -12,6 +12,7 @@ use Baraja\Cms\Settings; use Baraja\Cms\User\Entity\CmsUser; use Baraja\Cms\User\Entity\UserLogin; +use Baraja\Cms\User\Entity\UserMeta; use Baraja\Cms\User\Entity\UserMetaRepository; use Baraja\Cms\User\UserManager; use Baraja\Cms\User\UserMetaManager; @@ -131,7 +132,7 @@ public function actionDefault( ->getArrayResult(); /** @var UserMetaRepository $metaRepository */ - $metaRepository = $this->entityManager->getRepository(UserMetaRepository::class); + $metaRepository = $this->entityManager->getRepository(UserMeta::class); $metaToUser = $metaRepository->loadByUsersAndKeys( array_map(static fn(array $user): int => $user['id'], $users), diff --git a/src/MiddleWare/TemplateRenderer.php b/src/MiddleWare/TemplateRenderer.php index 2766d80..636bb94 100644 --- a/src/MiddleWare/TemplateRenderer.php +++ b/src/MiddleWare/TemplateRenderer.php @@ -14,6 +14,7 @@ use Baraja\Cms\Proxy\GlobalAsset\CmsSimpleStaticAsset; use Baraja\Cms\Settings; use Baraja\Cms\User\Entity\CmsUser; +use Baraja\Cms\User\Entity\UserResetPasswordRequest; use Baraja\Cms\User\Entity\UserResetPasswordRequestRepository; use Baraja\Plugin\BasePlugin; use Baraja\Plugin\CmsPluginPanel; @@ -152,7 +153,7 @@ public function renderLoginOtpAuthTemplate(string $locale): string public function renderResetPasswordTemplate(string $token, string $locale): string { /** @var UserResetPasswordRequestRepository $repository */ - $repository = $this->context->getEntityManager()->getRepository(UserResetPasswordRequestRepository::class); + $repository = $this->context->getEntityManager()->getRepository(UserResetPasswordRequest::class); try { $request = $repository->getByToken($token); diff --git a/src/Settings/DoctrineStorage.php b/src/Settings/DoctrineStorage.php index 3c5f68c..009f1df 100644 --- a/src/Settings/DoctrineStorage.php +++ b/src/Settings/DoctrineStorage.php @@ -22,7 +22,7 @@ public function __construct( private EntityManagerInterface $entityManager, ) { /** @var OptionRepository $optionRepository */ - $optionRepository = $entityManager->getRepository(OptionRepository::class); + $optionRepository = $entityManager->getRepository(Option::class); $this->optionRepository = $optionRepository; } diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index 13c496c..51a7a9d 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -8,6 +8,7 @@ use Baraja\BarajaCloud\CloudManager; use Baraja\Cms\Settings\SystemInfo; use Baraja\Cms\User\UserManagerAccessor; +use Baraja\DoctrineConfiguration\Option; use Baraja\DoctrineConfiguration\OptionRepository; use Baraja\DynamicConfiguration\Configuration; use Baraja\DynamicConfiguration\ConfigurationSection; @@ -92,7 +93,7 @@ public function isDatabaseConnectionOk(): bool } /** @var OptionRepository $optionRepository */ - $optionRepository = $this->entityManager->getRepository(OptionRepository::class); + $optionRepository = $this->entityManager->getRepository(Option::class); $status = $optionRepository->isOptionExist(); if ($status === true) { diff --git a/src/User/UserManager.php b/src/User/UserManager.php index 63f4f24..94a04c9 100644 --- a/src/User/UserManager.php +++ b/src/User/UserManager.php @@ -363,7 +363,7 @@ public function isLoginFirewallBlocked(string $username, ?string $ip = null): bo } /** @var UserLoginAttemptRepository $attemptRepository */ - $attemptRepository = $this->entityManager->getRepository(UserLoginAttemptRepository::class); + $attemptRepository = $this->entityManager->getRepository(UserLoginAttempt::class); $attempts = $attemptRepository->getUsedAttempts($username, $blockInterval, $ip, (int) $blockCount); return count($attempts) >= (int) $blockCount; diff --git a/src/User/UserMetaManager.php b/src/User/UserMetaManager.php index b52e982..2e56727 100644 --- a/src/User/UserMetaManager.php +++ b/src/User/UserMetaManager.php @@ -28,7 +28,7 @@ public function __construct( public function loadAll(int $userId): self { /** @var UserMetaRepository $userMetaRepository */ - $userMetaRepository = $this->entityManager->getRepository(UserMetaRepository::class); + $userMetaRepository = $this->entityManager->getRepository(UserMeta::class); foreach ($userMetaRepository->loadAll($userId) as $meta) { $cacheKey = $this->getCacheKey($userId, $meta->getKey()); @@ -47,7 +47,7 @@ public function get(int $userId, string $key): ?string } try { /** @var UserMetaRepository $userMetaRepository */ - $userMetaRepository = $this->entityManager->getRepository(UserMetaRepository::class); + $userMetaRepository = $this->entityManager->getRepository(UserMeta::class); $meta = $userMetaRepository->load($userId, $key); self::$cache[$cacheKey] = $meta; @@ -71,7 +71,7 @@ public function set(int $userId, string $key, ?string $value): self $cacheKey = $this->getCacheKey($user->getId(), $key); try { /** @var UserMetaRepository $userMetaRepository */ - $userMetaRepository = $this->entityManager->getRepository(UserMetaRepository::class); + $userMetaRepository = $this->entityManager->getRepository(UserMeta::class); /** @var UserMeta $meta */ $meta = self::$cache[$cacheKey] ?? $userMetaRepository->load($user->getId(), $key); } catch (NoResultException | NonUniqueResultException) {