From 232ee95dfb154b0b02f618652121d03de4bbf16e Mon Sep 17 00:00:00 2001 From: Marcel Kallen <1263478-MKHSKY@users.noreply.gitlab.com> Date: Wed, 1 Dec 2021 22:22:16 +0100 Subject: [PATCH] Remoted the tenantrepositorytrait due to missfunctions --- .../Abstraction/TenantRepositoryTrait.php | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/Repository/Abstraction/TenantRepositoryTrait.php diff --git a/src/Repository/Abstraction/TenantRepositoryTrait.php b/src/Repository/Abstraction/TenantRepositoryTrait.php deleted file mode 100644 index dd716ef..0000000 --- a/src/Repository/Abstraction/TenantRepositoryTrait.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ - -namespace Fluxter\SaasProviderBundle\Repository\Abstraction; - -use Fluxter\SaasProviderBundle\Model\TenantInterface; -use Fluxter\SaasProviderBundle\Service\TenantService; - -trait TenantRepositoryTrait -{ - protected TenantService $clientService; - - /** @required */ - public function setTenantService(TenantService $clientService) - { - $this->clientService = $clientService; - } - - public function createQueryBuilder($alias, $indexBy = null, ?TenantInterface $tenant = null) - { - if (null == $tenant) { - $tenant = $this->clientService->getTenant(); - } - - return parent::createQueryBuilder($alias, $indexBy) - ->andWhere($alias . '.tenant = :saasTenantId') - ->setParameter('saasTenantId', $tenant->getId()); - } - - // THIS IS ONLY FOR CONSOLE COMMANDS OR SOMETHING! - public function createGlobalQueryBuilder($alias, $indexBy = null) - { - return parent::createGlobalQueryBuilder($alias, $indexBy); - } -}