Completed
Push — master ( b35943...004856 )
by greg
08:37 queued 05:37
created

Invitation::findByHost()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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 findByHost($user)
14
    {
15
        return $this->getEntityRepository()->findBy(array('host'=>$user));
16
    }
17
18
    public function findByRequestKey($key)
19
    {
20
        return $this->getEntityRepository()->findBy(array('requestKey'=>$key));
21
    }
22
23
    /**
24
     * @return \Heineken\Entity\Invitation
25
     */
26
    public function findByGame($game)
27
    {
28
        return $this->getEntityRepository()->findBy(array('game'=>$game));
29
    }
30
31
    public function getEntityRepository()
32
    {
33
        return $this->em->getRepository('PlaygroundGame\Entity\Invitation');
34
    }
35
}
36