| 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 = []) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | public function getName() |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return EntityInterface |
||
| 60 | */ |
||
| 61 | public function getEntity() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return array |
||
| 68 | */ |
||
| 69 | public function getData() |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @param array $data |
||
| 76 | */ |
||
| 77 | public function setData($data) |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @return array |
||
| 84 | */ |
||
| 85 | public function getErrors() |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @param array $errors |
||
| 92 | */ |
||
| 93 | public function setErrors(array $errors) |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @return array |
||
| 100 | */ |
||
| 101 | public function getValidData() |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @param array $validData |
||
| 111 | */ |
||
| 112 | public function setValidData($validData) |
||
| 116 | } |
||
| 117 |