public function getFlatTreeQB($path = '', $rootAlias = 't', $extraParams = array())
    {
        $qb = $this->createQueryBuilder($rootAlias)
            ->andWhere($rootAlias.'.materializedPath LIKE :path')
            ->addOrderBy($rootAlias.'.materializedPath', 'ASC')
            ->setParameter('path', $path.'%')
        ;

        $parentId = basename($path);
        if ($parentId) {
            $qb
                ->orWhere($rootAlias.'.id = :parent')
                ->setParameter('parent', $parentId)
            ;
        }

        $this->addFlatTreeConditions($qb, $extraParams);

        return $qb;
    }
public function getFlatTreeQB($path = '', $rootAlias = 't', $extraParams = array())
    {
        $qb = $this->createQueryBuilder($rootAlias)
            ->andWhere($rootAlias.'.materializedPath LIKE :path')
            ->addOrderBy($rootAlias.'.materializedPath', 'ASC')
            ->setParameter('path', $path.'%')
        ;

        $parentId = basename($path);
        if ($parentId) {
            $qb
                ->orWhere($rootAlias.'.id = :parent')
                ->setParameter('parent', $parentId)
            ;
        }

        $this->addFlatTreeConditions($qb, $extraParams);

        return $qb;
    }
public function getFlatTreeQB ( $ path = '' , $ rootAlias = 't' , $ extraParams = array ( ) ) { $ qb = $ this -> createQueryBuilder ( $ rootAlias ) -> andWhere ( $ rootAlias . '.materializedPath LIKE :path' ) -> addOrderBy ( $ rootAlias . '.materializedPath' , 'ASC' ) -> setParameter ( 'path' , $ path . '%' ) ; $ parentId = basename ( $ path ) ; if ( $ parentId ) { $ qb -> orWhere ( $ rootAlias . '.id = :parent' ) -> setParameter ( 'parent' , $ parentId ) ; } $ this -> addFlatTreeConditions ( $ qb , $ extraParams ) ; return $ qb ; }
Constructs a query builder to get a flat tree, starting from a given path

@param string $path
@param string $rootAlias
@param array  $extraParams To be used in addFlatTreeConditions

@return QueryBuilder
Constructs a query builder to get a flat tree starting from a given path