src/Tenant/EventListener/ContextListener.php
public function onPreAuthentication()
    {
        $this->entityManager->getConfiguration()->addFilter('tenant', TenantFilter::class);
        $filter = $this->entityManager->getFilters()->enable('tenant');
        $tenant = $this->tenantService->getContext();
        $filter->setParameter('tenant', (string) $tenant);
    }
public function onPreAuthentication()
    {
        $this->entityManager->getConfiguration()->addFilter('tenant', TenantFilter::class);
        $filter = $this->entityManager->getFilters()->enable('tenant');
        $tenant = $this->tenantService->getContext();
        $filter->setParameter('tenant', (string) $tenant);
    }
public function onPreAuthentication ( ) { $ this -> entityManager -> getConfiguration ( ) -> addFilter ( 'tenant' , TenantFilter :: class ) ; $ filter = $ this -> entityManager -> getFilters ( ) -> enable ( 'tenant' ) ; $ tenant = $ this -> tenantService -> getContext ( ) ; $ filter -> setParameter ( 'tenant' , ( string ) $ tenant ) ; }
Determine the contextual tenant
Determine the contextual tenant