OrderCreatedEvent.php 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: 芸众商城 www.yunzshop.com
  5. * Date: 2017/3/3
  6. * Time: 上午11:44
  7. */
  8. namespace app\common\events\order;
  9. use app\common\events\Event;
  10. use app\common\models\Order;
  11. class OrderCreatedEvent extends Event
  12. {
  13. /**
  14. * @var Order
  15. */
  16. private $_order_model;
  17. /**
  18. * Create a new event instance.
  19. *
  20. * @return void
  21. */
  22. public function __construct(Order $order_model)
  23. {
  24. $this->_order_model = $order_model;
  25. }
  26. /**
  27. * @return Order
  28. */
  29. public function getOrder()
  30. {
  31. return $this->_order_model;;
  32. }
  33. /**
  34. * (监听者)获取订单model
  35. * @return mixed
  36. */
  37. public function getOrderModel()
  38. {
  39. return $this->_order_model;
  40. }
  41. /**
  42. * Get the channels the event should be broadcast on.
  43. *
  44. * @return array
  45. */
  46. public function broadcastOn()
  47. {
  48. return [];
  49. }
  50. }