EventManager   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 40
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A save() 0 5 1
A delete() 0 5 1
1
<?php
2
3
namespace Itkg\DelayEventBundle\DomainManager;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
use Itkg\DelayEventBundle\Model\Event;
7
8
/**
9
 * Class EventManager
10
 */
11
class EventManager implements EventManagerInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $class;
17
18
    /**
19
     * @var ObjectManager
20
     */
21
    protected $om;
22
23
    /**
24
     * @param string          $class
25
     * @param ObjectManager   $om
26
     */
27
    public function __construct($class, ObjectManager $om)
28
    {
29
        $this->class = $class;
30
        $this->om = $om;
31
    }
32
33
    /**
34
     * @param Event $event
35
     */
36
    public function save(Event $event)
37
    {
38
        $this->om->persist($event);
39
        $this->om->flush($event);
40
    }
41
42
    /**
43
     * @param Event $event
44
     */
45
    public function delete(Event $event)
46
    {
47
        $this->om->remove($event);
48
        $this->om->flush($event);
49
    }
50
}
51