SearchUpdateEvent.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Search\Events;
  3. use App\Models\Company;
  4. use App\Models\Jobs;
  5. use App\Models\Resume;
  6. /**
  7. * 搜索引擎更新事件,用于触发搜索引擎数据更新事件
  8. * Class SearchUpdateEvent
  9. * @package App\Search\Events
  10. * Auth Zhong
  11. * Date 2019/1/22
  12. */
  13. class SearchUpdateEvent
  14. {
  15. const MODEL_JOB = Jobs::class;
  16. const MODEL_COMPANY = Company::class;
  17. const MODEL_RESUME = Resume::class;
  18. const OPERATE_UPDATE = 'update';
  19. const OPERATE_DELETE = 'delete';
  20. /**
  21. * @var string 修改的模型
  22. */
  23. public $changeModel;
  24. /**
  25. * @var mixed 查询条件
  26. */
  27. public $where;
  28. /**
  29. * @var string 更新类型:更新,删除
  30. */
  31. public $type;
  32. /**
  33. * SearchUpdateEvent constructor.
  34. * @param string $changeModel
  35. * @param mixed $where string为id字符串
  36. * @param string $type
  37. */
  38. public function __construct(string $changeModel, $where, string $type)
  39. {
  40. $this->changeModel = $changeModel;
  41. $this->where = $where;
  42. $this->type = $type;
  43. }
  44. }