public function findUnfinishedPapers(Exercise $exercise, User $user)
    {
        return $this->createQueryBuilder('p')
            ->where('p.user = :user')
            ->andWhere('p.exercise = :exercise')
            ->andWhere('p.end IS NULL')
            ->orderBy('p.start', 'DESC')
            ->setParameters([
                'user' => $user,
                'exercise' => $exercise,
            ])
            ->getQuery()
            ->getResult();
    }
public function findUnfinishedPapers(Exercise $exercise, User $user)
    {
        return $this->createQueryBuilder('p')
            ->where('p.user = :user')
            ->andWhere('p.exercise = :exercise')
            ->andWhere('p.end IS NULL')
            ->orderBy('p.start', 'DESC')
            ->setParameters([
                'user' => $user,
                'exercise' => $exercise,
            ])
            ->getQuery()
            ->getResult();
    }
public function findUnfinishedPapers ( Exercise $ exercise , User $ user ) { return $ this -> createQueryBuilder ( 'p' ) -> where ( 'p.user = :user' ) -> andWhere ( 'p.exercise = :exercise' ) -> andWhere ( 'p.end IS NULL' ) -> orderBy ( 'p.start' , 'DESC' ) -> setParameters ( [ 'user' => $ user , 'exercise' => $ exercise , ] ) -> getQuery ( ) -> getResult ( ) ; }
Returns the unfinished papers of a user for a given exercise, if any.

@param Exercise $exercise
@param User     $user

@return Paper[]
Returns the unfinished papers of a user for a given exercise if any .