public function getAllPageIdsAndNamesBySiteThenType($siteId, $type)
    {
        $queryBuilder = $this->_em->createQueryBuilder();

        $queryBuilder->select('page.name, page.pageId')
            ->from(\Rcm\Entity\Page::class, 'page')
            ->join('page.site', 'site')
            ->where('page.pageType = :pageType')
            ->andWhere('site.siteId = :siteId')
            ->setParameter('pageType', $type)
            ->setParameter('siteId', $siteId);

        $result = $queryBuilder->getQuery()->getArrayResult();

        if (empty($result)) {
            return null;
        }

        $return = [];

        foreach ($result as &$page) {
            $return[$page['pageId']] = $page['name'];
        }

        return $return;
    }
public function getAllPageIdsAndNamesBySiteThenType($siteId, $type)
    {
        $queryBuilder = $this->_em->createQueryBuilder();

        $queryBuilder->select('page.name, page.pageId')
            ->from(\Rcm\Entity\Page::class, 'page')
            ->join('page.site', 'site')
            ->where('page.pageType = :pageType')
            ->andWhere('site.siteId = :siteId')
            ->setParameter('pageType', $type)
            ->setParameter('siteId', $siteId);

        $result = $queryBuilder->getQuery()->getArrayResult();

        if (empty($result)) {
            return null;
        }

        $return = [];

        foreach ($result as &$page) {
            $return[$page['pageId']] = $page['name'];
        }

        return $return;
    }
public function getAllPageIdsAndNamesBySiteThenType ( $ siteId , $ type ) { $ queryBuilder = $ this -> _em -> createQueryBuilder ( ) ; $ queryBuilder -> select ( 'page.name, page.pageId' ) -> from ( \ Rcm \ Entity \ Page :: class , 'page' ) -> join ( 'page.site' , 'site' ) -> where ( 'page.pageType = :pageType' ) -> andWhere ( 'site.siteId = :siteId' ) -> setParameter ( 'pageType' , $ type ) -> setParameter ( 'siteId' , $ siteId ) ; $ result = $ queryBuilder -> getQuery ( ) -> getArrayResult ( ) ; if ( empty ( $ result ) ) { return null ; } $ return = [ ] ; foreach ( $ result as & $ page ) { $ return [ $ page [ 'pageId' ] ] = $ page [ 'name' ] ; } return $ return ; }
Get a list of page id's and page names by a given type

@param integer $siteId SiteId
@param string $type Page Type to Search By

@return array
Get a list of page id s and page names by a given type