Completed
Pull Request — master (#314)
by greg
03:20
created

TradingCardModel::queryByGame()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
namespace PlaygroundGame\Mapper;
3
4
use PlaygroundGame\Mapper\AbstractMapper;
5
6
class TradingCardModel extends AbstractMapper
7
{
8
9
    public function queryByGame($tradingcard)
10
    {
11
        $query = $this->em->createQuery(
12
            'SELECT tcm FROM PlaygroundGame\Entity\TradingCardModel tcm
13
                WHERE tcm.game = :game
14
                ORDER BY tcm.id ASC'
15
        );
16
        $query->setParameter('game', $tradingcard);
17
        return $query;
18
    }
19
20
    public function getEntityRepository()
21
    {
22
        if (null === $this->er) {
23
            $this->er = $this->em->getRepository('PlaygroundGame\Entity\TradingCardModel');
24
        }
25
26
        return $this->er;
27
    }
28
}
29