public function findByCompetency(Competency $competency)
    {
        return $this->createQueryBuilder('a')
            ->select(
                'a.id',
                'a.name',
                'a.resourceCount',
                'a.minResourceCount',
                'c.id AS competencyId',
                'l.name AS levelName',
                'l.value AS levelValue'
            )
            ->join('a.competencyAbilities', 'ca')
            ->join('ca.competency', 'c')
            ->join('ca.level', 'l')
            ->where('c.root = :root')
            ->andWhere('c.lft >= :lft')
            ->andWhere('c.rgt <= :rgt')
            ->orderBy('l.value, a.id')
            ->setParameters([
                ':root' => $competency->getRoot(),
                ':lft' => $competency->getLeft(),
                ':rgt' => $competency->getRight(),
            ])
            ->getQuery()
            ->getArrayResult();
    }
public function findByCompetency(Competency $competency)
    {
        return $this->createQueryBuilder('a')
            ->select(
                'a.id',
                'a.name',
                'a.resourceCount',
                'a.minResourceCount',
                'c.id AS competencyId',
                'l.name AS levelName',
                'l.value AS levelValue'
            )
            ->join('a.competencyAbilities', 'ca')
            ->join('ca.competency', 'c')
            ->join('ca.level', 'l')
            ->where('c.root = :root')
            ->andWhere('c.lft >= :lft')
            ->andWhere('c.rgt <= :rgt')
            ->orderBy('l.value, a.id')
            ->setParameters([
                ':root' => $competency->getRoot(),
                ':lft' => $competency->getLeft(),
                ':rgt' => $competency->getRight(),
            ])
            ->getQuery()
            ->getArrayResult();
    }
public function findByCompetency ( Competency $ competency ) { return $ this -> createQueryBuilder ( 'a' ) -> select ( 'a.id' , 'a.name' , 'a.resourceCount' , 'a.minResourceCount' , 'c.id AS competencyId' , 'l.name AS levelName' , 'l.value AS levelValue' ) -> join ( 'a.competencyAbilities' , 'ca' ) -> join ( 'ca.competency' , 'c' ) -> join ( 'ca.level' , 'l' ) -> where ( 'c.root = :root' ) -> andWhere ( 'c.lft >= :lft' ) -> andWhere ( 'c.rgt <= :rgt' ) -> orderBy ( 'l.value, a.id' ) -> setParameters ( [ ':root' => $ competency -> getRoot ( ) , ':lft' => $ competency -> getLeft ( ) , ':rgt' => $ competency -> getRight ( ) , ] ) -> getQuery ( ) -> getArrayResult ( ) ; }
Returns an array representation of all the abilities linked
to a given competency tree. Result includes information
about ability level as well.

@param Competency $competency

@return array
Returns an array representation of all the abilities linked to a given competency tree . Result includes information about ability level as well .