Completed
Pull Request — master (#1015)
by Kévin
09:16 queued 06:42
created

TransformEvent::getObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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
use Elastica\Type;
16
17
class TransformEvent extends Event
18
{
19
    const PRE_TRANSFORM = 'fos_elastica.pre_transform';
20
    const POST_TRANSFORM = 'fos_elastica.post_transform';
21
22
    /**
23
     * @var mixed
24
     */
25
    private $document;
26
27
    /**
28
     * @var array
29
     */
30
    private $fields;
31
32
    /**
33
     * @var mixed
34
     */
35
    private $object;
36
37
    /**
38
     * @var Type|null
39
     */
40
    private $type;
41
42
    /**
43
     * @param mixed     $document
44
     * @param array     $fields
45
     * @param mixed     $object
46
     * @param Type|null $type
47
     */
48 3
    public function __construct($document, array $fields, $object, Type $type = null)
49
    {
50 3
        $this->document = $document;
51 3
        $this->fields = $fields;
52 3
        $this->object = $object;
53 3
        $this->type = $type;
54 3
    }
55
56
    /**
57
     * @return mixed
58
     */
59 3
    public function getDocument()
60
    {
61 3
        return $this->document;
62
    }
63
64
    /**
65
     * @return array
66
     */
67
    public function getFields()
68
    {
69
        return $this->fields;
70
    }
71
72
    /**
73
     * @return mixed
74
     */
75
    public function getObject()
76
    {
77
        return $this->object;
78
    }
79
80
    /**
81
     * @return Type
82
     */
83
    public function getType()
84
    {
85
        return $this->type;
86
    }
87
88
    /**
89
     * @param mixed $document
90
     */
91
    public function setDocument($document)
92
    {
93
        $this->document = $document;
94
    }
95
}
96