plugin/result/Repository/ResultRepository.php
public function findByUserAndWorkspace(User $user, Workspace $workspace)
    {
        $dql = '
            SELECT
                n.name AS title,
                m.value AS mark,
                r.total AS total
            FROM Claroline\ResultBundle\Entity\Result r
            JOIN r.resourceNode n
            JOIN n.workspace w
            JOIN r.marks m
            JOIN m.user u
            WHERE w = :workspace
            AND u = :user
            ORDER BY n.creationDate DESC, n.id
        ';

        $query = $this->_em->createQuery($dql);
        $query->setParameters([
            'workspace' => $workspace,
            'user' => $user,
        ]);

        return $query->getArrayResult();
    }
public function findByUserAndWorkspace(User $user, Workspace $workspace)
    {
        $dql = '
            SELECT
                n.name AS title,
                m.value AS mark,
                r.total AS total
            FROM Claroline\ResultBundle\Entity\Result r
            JOIN r.resourceNode n
            JOIN n.workspace w
            JOIN r.marks m
            JOIN m.user u
            WHERE w = :workspace
            AND u = :user
            ORDER BY n.creationDate DESC, n.id
        ';

        $query = $this->_em->createQuery($dql);
        $query->setParameters([
            'workspace' => $workspace,
            'user' => $user,
        ]);

        return $query->getArrayResult();
    }
public function findByUserAndWorkspace ( User $ user , Workspace $ workspace ) { $ dql = '
            SELECT
                n.name AS title,
                m.value AS mark,
                r.total AS total
            FROM Claroline\ResultBundle\Entity\Result r
            JOIN r.resourceNode n
            JOIN n.workspace w
            JOIN r.marks m
            JOIN m.user u
            WHERE w = :workspace
            AND u = :user
            ORDER BY n.creationDate DESC, n.id
        ' ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameters ( [ 'workspace' => $ workspace , 'user' => $ user , ] ) ; return $ query -> getArrayResult ( ) ; }
Returns an array representation of all the results associated
with a user in a given workspace.

@param User      $user
@param Workspace $workspace

@return array
Returns an array representation of all the results associated with a user in a given workspace .