public function findOthersByCompetencyAndLevel(
        Competency $competency,
        Level $level,
        Ability $abilityToExclude
    ) {
        return $this->createQueryBuilder('a')
            ->select('a')
            ->join('a.competencyAbilities', 'ca')
            ->join('ca.competency', 'c')
            ->join('ca.level', 'l')
            ->where('c = :competency')
            ->andWhere('l = :level')
            ->andWhere('a <> :excluded')
            ->orderBy('l.value, a.id')
            ->setParameters([
                ':competency' => $competency,
                ':level' => $level,
                ':excluded' => $abilityToExclude,
            ])
            ->getQuery()
            ->getResult();
    }
public function findOthersByCompetencyAndLevel(
        Competency $competency,
        Level $level,
        Ability $abilityToExclude
    ) {
        return $this->createQueryBuilder('a')
            ->select('a')
            ->join('a.competencyAbilities', 'ca')
            ->join('ca.competency', 'c')
            ->join('ca.level', 'l')
            ->where('c = :competency')
            ->andWhere('l = :level')
            ->andWhere('a <> :excluded')
            ->orderBy('l.value, a.id')
            ->setParameters([
                ':competency' => $competency,
                ':level' => $level,
                ':excluded' => $abilityToExclude,
            ])
            ->getQuery()
            ->getResult();
    }
public function findOthersByCompetencyAndLevel ( Competency $ competency , Level $ level , Ability $ abilityToExclude ) { return $ this -> createQueryBuilder ( 'a' ) -> select ( 'a' ) -> join ( 'a.competencyAbilities' , 'ca' ) -> join ( 'ca.competency' , 'c' ) -> join ( 'ca.level' , 'l' ) -> where ( 'c = :competency' ) -> andWhere ( 'l = :level' ) -> andWhere ( 'a <> :excluded' ) -> orderBy ( 'l.value, a.id' ) -> setParameters ( [ ':competency' => $ competency , ':level' => $ level , ':excluded' => $ abilityToExclude , ] ) -> getQuery ( ) -> getResult ( ) ; }
Returns the abilities directly linked to a given competency and
a particular level, excluding a given ability.

@param Competency $competency
@param Level      $level

@return array
Returns the abilities directly linked to a given competency and a particular level excluding a given ability .