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

TradingCardModel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A queryByGame() 0 10 1
A getEntityRepository() 0 8 2
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