public function findByUserAndCompetencyIds(User $user, array $competencyIds)
    {
        if (0 === count($competencyIds)) {
            return [];
        }

        return $this->createQueryBuilder('p')
            ->select('p', 'c')
            ->join('p.competency', 'c')
            ->where('p.user = :user')
            ->andWhere((new Expr())->in('p.competency', $competencyIds))
            ->setParameter(':user', $user)
            ->getQuery()
            ->getResult();
    }
public function findByUserAndCompetencyIds(User $user, array $competencyIds)
    {
        if (0 === count($competencyIds)) {
            return [];
        }

        return $this->createQueryBuilder('p')
            ->select('p', 'c')
            ->join('p.competency', 'c')
            ->where('p.user = :user')
            ->andWhere((new Expr())->in('p.competency', $competencyIds))
            ->setParameter(':user', $user)
            ->getQuery()
            ->getResult();
    }
public function findByUserAndCompetencyIds ( User $ user , array $ competencyIds ) { if ( 0 === count ( $ competencyIds ) ) { return [ ] ; } return $ this -> createQueryBuilder ( 'p' ) -> select ( 'p' , 'c' ) -> join ( 'p.competency' , 'c' ) -> where ( 'p.user = :user' ) -> andWhere ( ( new Expr ( ) ) -> in ( 'p.competency' , $ competencyIds ) ) -> setParameter ( ':user' , $ user ) -> getQuery ( ) -> getResult ( ) ; }
Returns every competency progress entity related to a
given user and whose id is in a given set.

@param User  $user
@param array $competencyIds

@return array
Returns every competency progress entity related to a given user and whose id is in a given set .