Completed
Pull Request — 6.0-dev (#875)
by Simonas
08:47
created

BulkEvent   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 46
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getHeader() 0 4 1
A setHeader() 0 5 1
A getOperation() 0 4 1
A setOperation() 0 5 1
A getData() 0 4 1
A setData() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
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 ONGR\ElasticsearchBundle\Event;
13
14
use Symfony\Component\EventDispatcher\Event;
15
16
class BulkEvent extends Event
17
{
18
    private $operation;
19
    private $header;
20
    private $data;
21
22
    public function __construct(string $operation, array $header, array $data = [])
23
    {
24
        $this->operation = $operation;
25
        $this->header = $header;
26
        $this->data = $data;
27
    }
28
29
    public function getHeader(): array
30
    {
31
        return $this->header;
32
    }
33
34
    public function setHeader(array $header): BulkEvent
35
    {
36
        $this->header = $header;
37
        return $this;
38
    }
39
40
    public function getData(): array
41
    {
42
        return $this->data;
43
    }
44
45
    public function setData(array $data): BulkEvent
46
    {
47
        $this->data = $data;
48
        return $this;
49
    }
50
51
    public function getOperation(): string
52
    {
53
        return $this->operation;
54
    }
55
56
    public function setOperation(string $operation): BulkEvent
57
    {
58
        $this->operation = $operation;
59
        return $this;
60
    }
61
}
62