| 1 | <?php |
||
| 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 = []) { |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | public function getName() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return EntityInterface |
||
| 58 | */ |
||
| 59 | public function getEntity() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return array |
||
| 66 | */ |
||
| 67 | public function getData() |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @param array $data |
||
| 74 | */ |
||
| 75 | public function setData($data) |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @return array |
||
| 82 | */ |
||
| 83 | public function getErrors() |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param array $errors |
||
| 90 | */ |
||
| 91 | public function setErrors(array $errors) |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @return array |
||
| 98 | */ |
||
| 99 | public function getValidData() |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @param array $validData |
||
| 106 | */ |
||
| 107 | public function setValidData($validData) |
||
| 111 | } |