VmEvent.php 996 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\App\Events\Cloud;
  3. use ModulesGarden\ProxmoxAddon\App\Models\VmModel;
  4. use ModulesGarden\ProxmoxAddon\Core\Events\Event;
  5. abstract class VmEvent extends Event
  6. {
  7. /**
  8. * @var VmModel
  9. */
  10. protected $vmModel;
  11. /**
  12. * @var array
  13. */
  14. protected $config;
  15. public function __construct(VmModel $vm, $config=[])
  16. {
  17. $this->vmModel = $vm;
  18. $this->config = $config;
  19. }
  20. /**
  21. * @return VmModel
  22. */
  23. public function getVmModel()
  24. {
  25. return $this->vmModel;
  26. }
  27. /**
  28. * @param VmModel $vmModel
  29. */
  30. public function setVmModel($vmModel)
  31. {
  32. $this->vmModel = $vmModel;
  33. }
  34. /**
  35. * @return array
  36. */
  37. public function getConfig()
  38. {
  39. return $this->config;
  40. }
  41. /**
  42. * @param array $config
  43. * @return $this
  44. */
  45. public function setConfig($config)
  46. {
  47. $this->config = $config;
  48. return $this;
  49. }
  50. }