| @@ 6-27 (lines=22) @@ | ||
| 3 | ||
| 4 | use PlaygroundGame\Mapper\AbstractMapper; |
|
| 5 | ||
| 6 | class MemoryCard extends AbstractMapper |
|
| 7 | { |
|
| 8 | public function queryByGame($tradingcard) |
|
| 9 | { |
|
| 10 | $query = $this->em->createQuery( |
|
| 11 | 'SELECT mc FROM PlaygroundGame\Entity\MemoryCard mc |
|
| 12 | WHERE mc.game = :game |
|
| 13 | ORDER BY mc.id ASC' |
|
| 14 | ); |
|
| 15 | $query->setParameter('game', $tradingcard); |
|
| 16 | return $query; |
|
| 17 | } |
|
| 18 | ||
| 19 | public function getEntityRepository() |
|
| 20 | { |
|
| 21 | if (null === $this->er) { |
|
| 22 | $this->er = $this->em->getRepository('PlaygroundGame\Entity\MemoryCard'); |
|
| 23 | } |
|
| 24 | ||
| 25 | return $this->er; |
|
| 26 | } |
|
| 27 | } |
|
| 28 | ||
| @@ 6-27 (lines=22) @@ | ||
| 3 | ||
| 4 | use PlaygroundGame\Mapper\AbstractMapper; |
|
| 5 | ||
| 6 | class TradingCardModel extends AbstractMapper |
|
| 7 | { |
|
| 8 | public function queryByGame($tradingcard) |
|
| 9 | { |
|
| 10 | $query = $this->em->createQuery( |
|
| 11 | 'SELECT tcm FROM PlaygroundGame\Entity\TradingCardModel tcm |
|
| 12 | WHERE tcm.game = :game |
|
| 13 | ORDER BY tcm.id ASC' |
|
| 14 | ); |
|
| 15 | $query->setParameter('game', $tradingcard); |
|
| 16 | return $query; |
|
| 17 | } |
|
| 18 | ||
| 19 | public function getEntityRepository() |
|
| 20 | { |
|
| 21 | if (null === $this->er) { |
|
| 22 | $this->er = $this->em->getRepository('PlaygroundGame\Entity\TradingCardModel'); |
|
| 23 | } |
|
| 24 | ||
| 25 | return $this->er; |
|
| 26 | } |
|
| 27 | } |
|
| 28 | ||