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

TransformEvent   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 47.06%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 79
ccs 8
cts 17
cp 0.4706
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getDocument() 0 4 1
A getFields() 0 4 1
A getObject() 0 4 1
A getType() 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
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