Completed
Push — master ( f2f7ef...c782fc )
by Karel
04:31 queued 10s
created

TransformEvent::setDocument()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the FOSElasticaBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
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 Elastica\Document;
15
use Symfony\Component\EventDispatcher\Event;
16
17
class TransformEvent extends Event
18
{
19
    /**
20
     * @Event("FOS\ElasticaBundle\Event\TransformEvent")
21
     */
22
    const PRE_TRANSFORM = 'fos_elastica.pre_transform';
23
24
    /**
25
     * @Event("FOS\ElasticaBundle\Event\TransformEvent")
26
     */
27
    const POST_TRANSFORM = 'fos_elastica.post_transform';
28
29
    /**
30
     * @var Document
31
     */
32
    private $document;
33
34
    /**
35
     * @var array
36
     */
37
    private $fields;
38
39
    /**
40
     * @var object
41
     */
42
    private $object;
43
44
    /**
45
     * @param mixed $document
46
     * @param array $fields
47
     * @param object $object
48
     */
49 6
    public function __construct($document, array $fields, $object)
50
    {
51 6
        $this->document = $document;
52 6
        $this->fields = $fields;
53 6
        $this->object = $object;
54 6
    }
55
56
    /**
57
     * @return Document
58
     */
59 4
    public function getDocument()
60
    {
61 4
        return $this->document;
62
    }
63
64
    /**
65
     * @return array
66
     */
67 1
    public function getFields()
68
    {
69 1
        return $this->fields;
70
    }
71
72
    /**
73
     * @return object
74
     */
75 1
    public function getObject()
76
    {
77 1
        return $this->object;
78
    }
79
80
    /**
81
     * @param Document $document
82
     */
83 1
    public function setDocument($document)
84
    {
85 1
        $this->document = $document;
86 1
    }
87
}
88