public function findByWorkspaceWithUsersFromGroup(Workspace $workspace, $executeQuery = true)
    {
        $dql = '
            SELECT u
            FROM Claroline\CoreBundle\Entity\User u
            JOIN u.roles ur
            LEFT JOIN u.groups g
            LEFT JOIN g.roles gr
            LEFT JOIN gr.workspace grws
            LEFT JOIN ur.workspace uws
            WHERE (uws.id = :wsId
            OR grws.id = :wsId)
            AND u.isRemoved = false
         ';
        $query = $this->_em->createQuery($dql);
        $query->setParameter('wsId', $workspace->getId());

        return $executeQuery ? $query->getResult() : $query;
    }
public function findByWorkspaceWithUsersFromGroup(Workspace $workspace, $executeQuery = true)
    {
        $dql = '
            SELECT u
            FROM Claroline\CoreBundle\Entity\User u
            JOIN u.roles ur
            LEFT JOIN u.groups g
            LEFT JOIN g.roles gr
            LEFT JOIN gr.workspace grws
            LEFT JOIN ur.workspace uws
            WHERE (uws.id = :wsId
            OR grws.id = :wsId)
            AND u.isRemoved = false
         ';
        $query = $this->_em->createQuery($dql);
        $query->setParameter('wsId', $workspace->getId());

        return $executeQuery ? $query->getResult() : $query;
    }
public function findByWorkspaceWithUsersFromGroup ( Workspace $ workspace , $ executeQuery = true ) { $ dql = '
            SELECT u
            FROM Claroline\CoreBundle\Entity\User u
            JOIN u.roles ur
            LEFT JOIN u.groups g
            LEFT JOIN g.roles gr
            LEFT JOIN gr.workspace grws
            LEFT JOIN ur.workspace uws
            WHERE (uws.id = :wsId
            OR grws.id = :wsId)
            AND u.isRemoved = false
         ' ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameter ( 'wsId' , $ workspace -> getId ( ) ) ; return $ executeQuery ? $ query -> getResult ( ) : $ query ; }
Returns the users who are members of one of the given workspaces. Users's groups ARE
taken into account.

@param Workspace $workspace
@param bool      $executeQuery

@return array
Returns the users who are members of one of the given workspaces . Users s groups ARE taken into account .