public function checkBonusEntry($game, $user)
    {
        $query = $this->em->createQuery(
            'SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e 
             WHERE e.user = :user AND e.game = :game AND (e.bonus = 0 OR e.bonus IS NULL)'
        );
        $query->setParameter('user', $user);
        $query->setParameter('game', $game);
        $nbEntries = $query->getSingleScalarResult();

        $query = $this->em->createQuery(
            'SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e 
             WHERE e.user = :user AND e.game = :game AND e.bonus = 1'
        );
        $query->setParameter('user', $user);
        $query->setParameter('game', $game);
        $nbBonusEntries = $query->getSingleScalarResult();

        if (($nbEntries - $nbBonusEntries) <= 0) {
            return false;
        }

        return true;
    }
public function checkBonusEntry($game, $user)
    {
        $query = $this->em->createQuery(
            'SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e 
             WHERE e.user = :user AND e.game = :game AND (e.bonus = 0 OR e.bonus IS NULL)'
        );
        $query->setParameter('user', $user);
        $query->setParameter('game', $game);
        $nbEntries = $query->getSingleScalarResult();

        $query = $this->em->createQuery(
            'SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e 
             WHERE e.user = :user AND e.game = :game AND e.bonus = 1'
        );
        $query->setParameter('user', $user);
        $query->setParameter('game', $game);
        $nbBonusEntries = $query->getSingleScalarResult();

        if (($nbEntries - $nbBonusEntries) <= 0) {
            return false;
        }

        return true;
    }
public function checkBonusEntry ( $ game , $ user ) { $ query = $ this -> em -> createQuery ( 'SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e 
             WHERE e.user = :user AND e.game = :game AND (e.bonus = 0 OR e.bonus IS NULL)' ) ; $ query -> setParameter ( 'user' , $ user ) ; $ query -> setParameter ( 'game' , $ game ) ; $ nbEntries = $ query -> getSingleScalarResult ( ) ; $ query = $ this -> em -> createQuery ( 'SELECT COUNT(e.id) FROM PlaygroundGame\Entity\Entry e 
             WHERE e.user = :user AND e.game = :game AND e.bonus = 1' ) ; $ query -> setParameter ( 'user' , $ user ) ; $ query -> setParameter ( 'game' , $ game ) ; $ nbBonusEntries = $ query -> getSingleScalarResult ( ) ; if ( ( $ nbEntries - $ nbBonusEntries ) <= 0 ) { return false ; } return true ; }
Compte les nombre de participations bonus
@param unknown_type $game
@param unknown_type $user
Compte les nombre de participations bonus