plugin/competency/Repository/ObjectiveRepository.php
public function findUsersWithObjective(Objective $objective)
    {
        $usersQb = $this->createQueryBuilder('o1')
            ->select('ou.id')
            ->join('o1.users', 'ou')
            ->where('o1 = :objective');
        $groupsQb = $this->createQueryBuilder('o2')
            ->select('og.id')
            ->join('o2.groups', 'og')
            ->where('o2 = :objective');

        return $this->_em->createQueryBuilder()
            ->select('u')
            ->from('Claroline\CoreBundle\Entity\User', 'u')
            ->leftJoin('HeVinci\CompetencyBundle\Entity\Progress\UserProgress', 'up', 'WITH', 'up.user = u')
            ->leftJoin('u.groups', 'ug')
            ->where((new Expr())->in('u.id', $usersQb->getDQL()))
            ->orWhere((new Expr())->in('ug.id', $groupsQb->getDQL()))
            ->setParameter(':objective', $objective)
            ->getQuery()
            ->getResult();
    }
public function findUsersWithObjective(Objective $objective)
    {
        $usersQb = $this->createQueryBuilder('o1')
            ->select('ou.id')
            ->join('o1.users', 'ou')
            ->where('o1 = :objective');
        $groupsQb = $this->createQueryBuilder('o2')
            ->select('og.id')
            ->join('o2.groups', 'og')
            ->where('o2 = :objective');

        return $this->_em->createQueryBuilder()
            ->select('u')
            ->from('Claroline\CoreBundle\Entity\User', 'u')
            ->leftJoin('HeVinci\CompetencyBundle\Entity\Progress\UserProgress', 'up', 'WITH', 'up.user = u')
            ->leftJoin('u.groups', 'ug')
            ->where((new Expr())->in('u.id', $usersQb->getDQL()))
            ->orWhere((new Expr())->in('ug.id', $groupsQb->getDQL()))
            ->setParameter(':objective', $objective)
            ->getQuery()
            ->getResult();
    }
public function findUsersWithObjective ( Objective $ objective ) { $ usersQb = $ this -> createQueryBuilder ( 'o1' ) -> select ( 'ou.id' ) -> join ( 'o1.users' , 'ou' ) -> where ( 'o1 = :objective' ) ; $ groupsQb = $ this -> createQueryBuilder ( 'o2' ) -> select ( 'og.id' ) -> join ( 'o2.groups' , 'og' ) -> where ( 'o2 = :objective' ) ; return $ this -> _em -> createQueryBuilder ( ) -> select ( 'u' ) -> from ( 'Claroline\CoreBundle\Entity\User' , 'u' ) -> leftJoin ( 'HeVinci\CompetencyBundle\Entity\Progress\UserProgress' , 'up' , 'WITH' , 'up.user = u' ) -> leftJoin ( 'u.groups' , 'ug' ) -> where ( ( new Expr ( ) ) -> in ( 'u.id' , $ usersQb -> getDQL ( ) ) ) -> orWhere ( ( new Expr ( ) ) -> in ( 'ug.id' , $ groupsQb -> getDQL ( ) ) ) -> setParameter ( ':objective' , $ objective ) -> getQuery ( ) -> getResult ( ) ; }
Returns all the users and group members who have a given objective.

@param Objective $objective

@return array
Returns all the users and group members who have a given objective .