| 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 $errors = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * EntityEvent constructor. |
||
| 33 | * @param string $name |
||
| 34 | * @param EntityInterface $entity |
||
| 35 | * @param array $data |
||
| 36 | */ |
||
| 37 | public function __construct($name, EntityInterface $entity = null, array $data = []) { |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function getName() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return EntityInterface |
||
| 53 | */ |
||
| 54 | public function getEntity() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | public function getData() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @param array $data |
||
| 69 | */ |
||
| 70 | public function setData($data) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return array |
||
| 77 | */ |
||
| 78 | public function getErrors() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @param array $errors |
||
| 85 | */ |
||
| 86 | public function setErrors(array $errors) |
||
| 90 | } |