for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Superdesk Web Publisher MultiTenancy Bundle.
*
* Copyright 2015 Sourcefabric z.u. and contributors.
* For the full copyright and license information, please see the
* AUTHORS and LICENSE files distributed with this source code.
* @copyright 2015 Sourcefabric z.ú.
* @license http://www.superdesk.org/license
*/
namespace SWP\MultiTenancyBundle\Repository;
use Doctrine\ORM\EntityRepository;
use SWP\Component\MultiTenancy\Repository\TenantRepositoryInterface;
* Repository interface for tenants.
class TenantRepository extends EntityRepository implements TenantRepositoryInterface
{
* {@inheritdoc}
public function findBySubdomain($subdomain)
return $this
->createQueryBuilder('t')
->where('t.subdomain = :subdomain')
->andWhere('t.enabled = true')
->setParameter('subdomain', $subdomain)
->getQuery()
->getOneOrNullResult()
;
}
public function findAvailableTenants()
->where('t.enabled = true')
->getArrayResult()