Completed
Push — master ( 864716...1105c6 )
by Dmitriy
04:08
created

EntityEvent::getValidData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace T4web\DomainModule;
4
5
use Zend\EventManager\Event;
6
use T4webDomainInterface\EntityInterface;
7
use T4webDomainInterface\EventInterface;
8
9
class EntityEvent extends Event implements EventInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $name;
15
16
    /**
17
     * @var EntityInterface
18
     */
19
    protected $entity;
20
21
    /**
22
     * @var array
23
     */
24
    protected $data = [];
25
26
    /**
27
     * @var array
28
     */
29
    protected $validData = [];
30
31
    /**
32
     * @var array
33
     */
34
    protected $errors = [];
35
36
    /**
37
     * EntityEvent constructor.
38
     * @param string $name
39
     * @param EntityInterface $entity
40
     * @param array $data
41
     */
42
    public function __construct($name, EntityInterface $entity = null, array $data = []) {
43
        $this->name = $name;
44
        $this->entity = $entity;
45
        $this->data = $data;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getName()
52
    {
53
        return $this->name;
54
    }
55
56
    /**
57
     * @return EntityInterface
58
     */
59
    public function getEntity()
60
    {
61
        return $this->entity;
62
    }
63
64
    /**
65
     * @return array
66
     */
67
    public function getData()
68
    {
69
        return $this->data;
70
    }
71
72
    /**
73
     * @param array $data
74
     */
75
    public function setData($data)
76
    {
77
        $this->data = $data;
78
    }
79
80
    /**
81
     * @return array
82
     */
83
    public function getErrors()
84
    {
85
        return $this->errors;
86
    }
87
88
    /**
89
     * @param array $errors
90
     */
91
    public function setErrors(array $errors)
92
    {
93
        $this->errors = $errors;
94
    }
95
96
    /**
97
     * @return array
98
     */
99
    public function getValidData()
100
    {
101
        return $this->validData;
102
    }
103
104
    /**
105
     * @param array $validData
106
     */
107
    public function setValidData($validData)
108
    {
109
        $this->validData = $validData;
110
    }
111
}