Completed
Push — master ( fef1f2...3eb154 )
by Tim
7s
created

TransformEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
3
/**
4
 * This file is part of the FOSElasticaBundle project.
5
 *
6
 * (c) Infinite Networks Pty Ltd <http://www.infinite.net.au>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\ElasticaBundle\Event;
13
14
use Symfony\Component\EventDispatcher\Event;
15
16
class TransformEvent extends Event
17
{
18
    /**
19
     * @Event("FOS\ElasticaBundle\Event\TransformEvent")
20
     */
21
    const PRE_TRANSFORM = 'fos_elastica.pre_transform';
22
23
    /**
24
     * @Event("FOS\ElasticaBundle\Event\TransformEvent")
25
     */
26
    const POST_TRANSFORM = 'fos_elastica.post_transform';
27
28
    /**
29
     * @var mixed
30
     */
31
    private $document;
32
33
    /**
34
     * @var array
35
     */
36
    private $fields;
37
38
    /**
39
     * @var mixed
40
     */
41
    private $object;
42
43
    /**
44
     * @param mixed $document
45
     * @param array $fields
46
     * @param mixed $object
47
     */
48 3
    public function __construct($document, array $fields, $object)
49
    {
50 3
        $this->document = $document;
51 3
        $this->fields = $fields;
52 3
        $this->object = $object;
53 3
    }
54
55
    /**
56
     * @return mixed
57
     */
58 3
    public function getDocument()
59
    {
60 3
        return $this->document;
61
    }
62
63
    /**
64
     * @return array
65
     */
66
    public function getFields()
67
    {
68
        return $this->fields;
69
    }
70
71
    /**
72
     * @return mixed
73
     */
74
    public function getObject()
75
    {
76
        return $this->object;
77
    }
78
79
    /**
80
     * @param mixed $document
81
     */
82
    public function setDocument($document)
83
    {
84
        $this->document = $document;
85
    }
86
}
87