Completed
Push — master ( 0aa154...6fc129 )
by Maksim
05:50
created

OnExceptionEvent::getObjects()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace FOS\ElasticaBundle\Persister\Event;
3
4
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
5
use FOS\ElasticaBundle\Provider\PagerInterface;
6
use Symfony\Component\EventDispatcher\Event;
7
8
final class OnExceptionEvent extends Event implements PersistEvent
9
{
10
    /**
11
     * @var PagerInterface
12
     */
13
    private $pager;
14
15
    /**
16
     * @var ObjectPersisterInterface
17
     */
18
    private $objectPersister;
19
20
    /**
21
     * @var \Exception
22
     */
23
    private $exception;
24
25
    /**
26
     * @var array
27
     */
28
    private $options;
29
30
    /**
31
     * @var array
32
     */
33
    private $objects;
34
35
    /**
36
     * @var bool
37
     */
38
    private $ignore;
39
40 11
    public function __construct(
41
        PagerInterface $pager, 
42
        ObjectPersisterInterface $objectPersister, 
43
        \Exception $exception, 
44
        array $objects, 
45
        array $options
46
    ) {
47 11
        $this->pager = $pager;
48 11
        $this->objectPersister = $objectPersister;
49 11
        $this->exception = $exception;
50 11
        $this->options = $options;
51
52 11
        $this->ignore = false;
53 11
        $this->objects = $objects;
54 11
    }
55
56
    /**
57
     * @return PagerInterface
58
     */
59 2
    public function getPager()
60
    {
61 2
        return $this->pager;
62
    }
63
64
    /**
65
     * @return array
66
     */
67 2
    public function getOptions()
68
    {
69 2
        return $this->options;
70
    }
71
72
    /**
73
     * @return ObjectPersisterInterface
74
     */
75 2
    public function getObjectPersister()
76
    {
77 2
        return $this->objectPersister;
78
    }
79
80
    /**
81
     * @return \Exception
82
     */
83 3
    public function getException()
84
    {
85 3
        return $this->exception;
86
    }
87
88
    /**
89
     * @param \Exception $exception
90
     */
91 1
    public function setException(\Exception $exception)
92
    {
93 1
        $this->exception = $exception;
94 1
    }
95
96
    /**
97
     * @return bool
98
     */
99 4
    public function isIgnored()
100
    {
101 4
        return $this->ignore;
102
    }
103
104
    /**
105
     * @param bool $ignore
106
     */
107 2
    public function setIgnore($ignore)
108
    {
109 2
        $this->ignore = !!$ignore;
110 2
    }
111
112
    /**
113
     * @return array
114
     */
115 1
    public function getObjects()
116
    {
117 1
        return $this->objects;
118
    }
119
}