Classes/Domain/Repository/PageRepository.php
public function findForBackend($pageId, $displayMode): array
    {
        $queryBuilder = $this->createQuery();

        $where = [];
        switch ($displayMode) {
            case 'current':
                $where[] = $queryBuilder->expr()->eq('uid', $pageId);
                break;
            case 'childs':
                $where[] = $queryBuilder->expr()->eq('pid', $pageId);
                break;
            case 'both':
                $where[] = $queryBuilder->expr()->eq('uid', $pageId);
                $where[] = $queryBuilder->expr()->eq('pid', $pageId);
                break;
        }

        return (array)$queryBuilder->select('*')
            ->from('pages')
            ->orWhere(...$where)
            ->execute()
            ->fetchAll();
    }
public function findForBackend($pageId, $displayMode): array
    {
        $queryBuilder = $this->createQuery();

        $where = [];
        switch ($displayMode) {
            case 'current':
                $where[] = $queryBuilder->expr()->eq('uid', $pageId);
                break;
            case 'childs':
                $where[] = $queryBuilder->expr()->eq('pid', $pageId);
                break;
            case 'both':
                $where[] = $queryBuilder->expr()->eq('uid', $pageId);
                $where[] = $queryBuilder->expr()->eq('pid', $pageId);
                break;
        }

        return (array)$queryBuilder->select('*')
            ->from('pages')
            ->orWhere(...$where)
            ->execute()
            ->fetchAll();
    }
public function findForBackend ( $ pageId , $ displayMode ) : array { $ queryBuilder = $ this -> createQuery ( ) ; $ where = [ ] ; switch ( $ displayMode ) { case 'current' : $ where [ ] = $ queryBuilder -> expr ( ) -> eq ( 'uid' , $ pageId ) ; break ; case 'childs' : $ where [ ] = $ queryBuilder -> expr ( ) -> eq ( 'pid' , $ pageId ) ; break ; case 'both' : $ where [ ] = $ queryBuilder -> expr ( ) -> eq ( 'uid' , $ pageId ) ; $ where [ ] = $ queryBuilder -> expr ( ) -> eq ( 'pid' , $ pageId ) ; break ; } return ( array ) $ queryBuilder -> select ( '*' ) -> from ( 'pages' ) -> orWhere ( ... $ where ) -> execute ( ) -> fetchAll ( ) ; }
Get for backend output.

@param int    $pageId
@param string $displayMode

@return array
Get for backend output .