ActivityStatusChangedEvent.php 961 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Module\Activity\Events;
  3. use Illuminate\Broadcasting\InteractsWithSockets;
  4. use Illuminate\Foundation\Events\Dispatchable;
  5. use Illuminate\Queue\SerializesModels;
  6. /**
  7. * 活动状态变更事件
  8. */
  9. class ActivityStatusChangedEvent
  10. {
  11. use Dispatchable, InteractsWithSockets, SerializesModels;
  12. /**
  13. * 活动ID
  14. *
  15. * @var int
  16. */
  17. public int $activityId;
  18. /**
  19. * 旧状态
  20. *
  21. * @var int
  22. */
  23. public int $oldStatus;
  24. /**
  25. * 新状态
  26. *
  27. * @var int
  28. */
  29. public int $newStatus;
  30. /**
  31. * 创建一个新的事件实例
  32. *
  33. * @param int $activityId 活动ID
  34. * @param int $oldStatus 旧状态
  35. * @param int $newStatus 新状态
  36. */
  37. public function __construct(int $activityId, int $oldStatus, int $newStatus)
  38. {
  39. $this->activityId = $activityId;
  40. $this->oldStatus = $oldStatus;
  41. $this->newStatus = $newStatus;
  42. }
  43. }