MemberCreateRelationEvent.php 797 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: dingran
  5. * Date: 2018/10/30
  6. * Time: 下午4:17
  7. */
  8. namespace app\common\events\member;
  9. use app\common\events\Event;
  10. class MemberCreateRelationEvent extends Event
  11. {
  12. protected $uid;
  13. protected $parent_id;
  14. protected $member;
  15. public function __construct($model, $parent_id)
  16. {
  17. if (is_int($model)) {
  18. $this->uid = $model;
  19. } else {
  20. $this->member = $model;
  21. $this->uid = $model->member_id;
  22. }
  23. $this->parent_id = $parent_id;
  24. }
  25. public function getUid()
  26. {
  27. return $this->uid;
  28. }
  29. public function getParentId()
  30. {
  31. return $this->parent_id;
  32. }
  33. public function getMemberModel()
  34. {
  35. return $this->member;
  36. }
  37. }