Completed
Pull Request — master (#1269)
by Wesley
11:25
created

TransformEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 71
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getDocument() 0 4 1
A getFields() 0 4 1
A getObject() 0 4 1
A setDocument() 0 4 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
/**
13
 * This file is part of the FOSElasticaBundle project.
14
 *
15
 * (c) Infinite Networks Pty Ltd <http://www.infinite.net.au>
16
 *
17
 * For the full copyright and license information, please view the LICENSE
18
 * file that was distributed with this source code.
19
 */
20
21
namespace FOS\ElasticaBundle\Event;
22
23
use Symfony\Component\EventDispatcher\Event;
24
25
class TransformEvent extends Event
26
{
27
    /**
28
     * @Event("FOS\ElasticaBundle\Event\TransformEvent")
29
     */
30
    const PRE_TRANSFORM = 'fos_elastica.pre_transform';
31
32
    /**
33
     * @Event("FOS\ElasticaBundle\Event\TransformEvent")
34
     */
35
    const POST_TRANSFORM = 'fos_elastica.post_transform';
36
37
    /**
38
     * @var mixed
39
     */
40
    private $document;
41
42
    /**
43
     * @var array
44
     */
45
    private $fields;
46
47
    /**
48
     * @var mixed
49
     */
50
    private $object;
51
52
    /**
53
     * @param mixed $document
54
     * @param array $fields
55
     * @param mixed $object
56
     */
57 3
    public function __construct($document, array $fields, $object)
58
    {
59 3
        $this->document = $document;
60 3
        $this->fields = $fields;
61 3
        $this->object = $object;
62 3
    }
63
64
    /**
65
     * @return mixed
66
     */
67 3
    public function getDocument()
68
    {
69 3
        return $this->document;
70
    }
71
72
    /**
73
     * @return array
74
     */
75
    public function getFields()
76
    {
77
        return $this->fields;
78
    }
79
80
    /**
81
     * @return mixed
82
     */
83
    public function getObject()
84
    {
85
        return $this->object;
86
    }
87
88
    /**
89
     * @param mixed $document
90
     */
91
    public function setDocument($document)
92
    {
93
        $this->document = $document;
94
    }
95
}
96