MongoDBRepository   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 46
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClassName() 0 4 1
A getManager() 0 4 1
A createQueryBuilder() 0 4 1
1
<?php
2
3
namespace Black\Bridge\Doctrine\Common\Persistence\MongoDB;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
7
/**
8
 * Class MongoDBRepository
9
 */
10
class MongoDBRepository
11
{
12
    /**
13
     * @var
14
     */
15
    protected $manager;
16
17
    /**
18
     * @var
19
     */
20
    protected $class;
21
22
    /**
23
     * @param ObjectManager $manager
24
     * @param $class
25
     */
26
    public function __construct(ObjectManager $manager, $class)
27
    {
28
        $this->manager = $manager;
29
        $this->class = $class;
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35
    public function getClassName() : string
36
    {
37
        return $this->class;
38
    }
39
40
    /**
41
     * @return ObjectManager
42
     */
43
    protected function getManager() : ObjectManager
44
    {
45
        return $this->manager;
46
    }
47
48
    /**
49
     * @return mixed
50
     */
51
     public function createQueryBuilder()
52
     {
53
         return $this->manager->createQueryBuilder($this->class);
54
     }
55
}
56