src/Sulu/Bundle/WebsiteBundle/Entity/DomainRepository.php
public function findByUrlAndEnvironment($url, $environment)
    {
        $queryBuilder = $this->createQueryBuilder('u')
            ->where('u.url = :url')
            ->andWhere('u.environment = :environment');

        $query = $queryBuilder->getQuery();
        $query->setParameter('url', $url);
        $query->setParameter('environment', $environment);

        try {
            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
public function findByUrlAndEnvironment($url, $environment)
    {
        $queryBuilder = $this->createQueryBuilder('u')
            ->where('u.url = :url')
            ->andWhere('u.environment = :environment');

        $query = $queryBuilder->getQuery();
        $query->setParameter('url', $url);
        $query->setParameter('environment', $environment);

        try {
            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
public function findByUrlAndEnvironment ( $ url , $ environment ) { $ queryBuilder = $ this -> createQueryBuilder ( 'u' ) -> where ( 'u.url = :url' ) -> andWhere ( 'u.environment = :environment' ) ; $ query = $ queryBuilder -> getQuery ( ) ; $ query -> setParameter ( 'url' , $ url ) ; $ query -> setParameter ( 'environment' , $ environment ) ; try { return $ query -> getSingleResult ( ) ; } catch ( NoResultException $ ex ) { return ; } }
Returns domain with given url and environment.

@param string $url
@param string $environment

@return Domain
Returns domain with given url and environment .