plugin/result/Repository/MarkRepository.php
public function findByResultAndUser(Result $result, User $user)
    {
        $dql = '
            SELECT
                u.id,
                CONCAT(u.firstName, \' \', u.lastName) AS name,
                m.value AS mark,
                m.id AS markId
            FROM Claroline\ResultBundle\Entity\Mark m
            JOIN m.user u
            WHERE m.result = :result
            AND u = :user
            ORDER BY u.lastName ASC
        ';

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

        return $query->getArrayResult();
    }
public function findByResultAndUser(Result $result, User $user)
    {
        $dql = '
            SELECT
                u.id,
                CONCAT(u.firstName, \' \', u.lastName) AS name,
                m.value AS mark,
                m.id AS markId
            FROM Claroline\ResultBundle\Entity\Mark m
            JOIN m.user u
            WHERE m.result = :result
            AND u = :user
            ORDER BY u.lastName ASC
        ';

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

        return $query->getArrayResult();
    }
public function findByResultAndUser ( Result $ result , User $ user ) { $ dql = '
            SELECT
                u.id,
                CONCAT(u.firstName, \' \', u.lastName) AS name,
                m.value AS mark,
                m.id AS markId
            FROM Claroline\ResultBundle\Entity\Mark m
            JOIN m.user u
            WHERE m.result = :result
            AND u = :user
            ORDER BY u.lastName ASC
        ' ; $ query = $ this -> _em -> createQuery ( $ dql ) ; $ query -> setParameters ( [ 'result' => $ result , 'user' => $ user , ] ) ; return $ query -> getArrayResult ( ) ; }
Returns an array representation of the mark associated
with a result for a given user.

@param Result $result
@param User   $user

@return array
Returns an array representation of the mark associated with a result for a given user .