main/core/Repository/WorkspaceRepository.php
public function findWorkspacesByManager(User $user, $executeQuery = true)
    {
        $roles = $user->getRoles();
        $managerRoles = [];

        foreach ($roles as $role) {
            if (strpos('_'.$role, 'ROLE_WS_MANAGER')) {
                $managerRoles[] = $role;
            }
        }

        $dql = '
            SELECT w
            FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w
            JOIN w.roles r
            WHERE r.name IN (:roleNames)

        ';

        $query = $this->_em->createQuery($dql);
        $query->setParameter('roleNames', $managerRoles);

        return $executeQuery ? $query->getResult() : $query;
    }
public function findWorkspacesByManager(User $user, $executeQuery = true)
    {
        $roles = $user->getRoles();
        $managerRoles = [];

        foreach ($roles as $role) {
            if (strpos('_'.$role, 'ROLE_WS_MANAGER')) {
                $managerRoles[] = $role;
            }
        }

        $dql = '
            SELECT w
            FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w
            JOIN w.roles r
            WHERE r.name IN (:roleNames)

        ';

        $query = $this->_em->createQuery($dql);
        $query->setParameter('roleNames', $managerRoles);

        return $executeQuery ? $query->getResult() : $query;
    }
public function findWorkspacesByManager ( User $ user , $ executeQuery = true ) { $ roles = $ user -> getRoles ( ) ; $ managerRoles = [ ] ; foreach ( $ roles as $ role ) { if ( strpos ( '_' . $ role , 'ROLE_WS_MANAGER' ) ) { $ managerRoles [ ] = $ role ; } } $ dql = '
            SELECT w
            FROM Claroline\\CoreBundle\\Entity\\Workspace\\Workspace w
            JOIN w.roles r
            WHERE r.name IN (:roleNames)

        ' ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameter ( 'roleNames' , $ managerRoles ) ; return $ executeQuery ? $ query -> getResult ( ) : $ query ; }
Eventually used by the message bundle.
Eventually used by the message bundle .