src/Sulu/Bundle/WebsiteBundle/Entity/AnalyticsRepository.php
public function findByWebspaceKey($webspaceKey)
    {
        $queryBuilder = $this->createQueryBuilder('a')
            ->addSelect('domains')
            ->leftJoin('a.domains', 'domains')
            ->where('a.webspaceKey = :webspaceKey')
            ->andWhere('a.allDomains = TRUE OR domains.environment = :environment')
            ->orderBy('a.id', 'ASC');

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

        return $query->getResult();
    }
public function findByWebspaceKey($webspaceKey)
    {
        $queryBuilder = $this->createQueryBuilder('a')
            ->addSelect('domains')
            ->leftJoin('a.domains', 'domains')
            ->where('a.webspaceKey = :webspaceKey')
            ->andWhere('a.allDomains = TRUE OR domains.environment = :environment')
            ->orderBy('a.id', 'ASC');

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

        return $query->getResult();
    }
public function findByWebspaceKey ( $ webspaceKey ) { $ queryBuilder = $ this -> createQueryBuilder ( 'a' ) -> addSelect ( 'domains' ) -> leftJoin ( 'a.domains' , 'domains' ) -> where ( 'a.webspaceKey = :webspaceKey' ) -> andWhere ( 'a.allDomains = TRUE OR domains.environment = :environment' ) -> orderBy ( 'a.id' , 'ASC' ) ; $ query = $ queryBuilder -> getQuery ( ) ; $ query -> setParameter ( 'webspaceKey' , $ webspaceKey ) ; $ query -> setParameter ( 'environment' , $ this -> environment ) ; return $ query -> getResult ( ) ; }
Returns list of analytics filterd by webspace key and environment.

@param string $webspaceKey

@return Analytics[]
Returns list of analytics filterd by webspace key and environment .