Completed
Push — master ( b08b67...b98ff3 )
by greg
10:52 queued 07:23
created

Invitation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A findByUser() 0 4 1
A findByRequestKey() 0 4 1
A findByGame() 0 4 1
A getEntityRepository() 0 4 1
1
<?php
2
namespace PlaygroundGame\Mapper;
3
4
use PlaygroundGame\Mapper\AbstractMapper;
5
6
class Invitation extends AbstractMapper
7
{
8
    public function findByUser($user)
9
    {
10
        return $this->getEntityRepository()->findBy(array('user'=>$user));
11
    }
12
13
    public function findByRequestKey($key)
14
    {
15
        return $this->getEntityRepository()->findBy(array('requestKey'=>$key));
16
    }
17
18
    /**
19
     * @return \Heineken\Entity\Invitation
20
     */
21
    public function findByGame($game)
22
    {
23
        return $this->getEntityRepository()->findBy(array('game'=>$game));
24
    }
25
26
    public function getEntityRepository()
27
    {
28
        return $this->em->getRepository('PlaygroundGame\Entity\Invitation');
29
    }
30
}
31