Completed
Push — master ( f2f7ef...c782fc )
by Karel
04:31 queued 10s
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 14
cts 14
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
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