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

TransformEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

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

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 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