PairMatchDataSource.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App\Services\Pair\DataModels;
  3. class PairMatchDataSource
  4. {
  5. /** @var int 用户id */
  6. public $uid;
  7. /** @var int 报名id */
  8. public $pairId;
  9. /** @var int 用户身高 */
  10. public $height;
  11. /** @var \DateTime 出生日期 */
  12. public $birthDate;
  13. /** @var int 匹配最小年龄 */
  14. public $matchMinAge;
  15. /** @var int 匹配最大年龄 */
  16. public $matchMaxAge;
  17. /** @var int 匹配半径 */
  18. public $matchRadius;
  19. /** @var float 报名定位经度 */
  20. public $enrollLongitude;
  21. /** @var float 报名定位纬度 */
  22. public $enrollLatitude;
  23. /** @var int 性别1男2女 */
  24. public $gender;
  25. /** @var int 性取向1男2女 */
  26. public $sexualOrientation;
  27. /** @var array 范围内的用户数组 */
  28. public $rangeUsers = array();
  29. public function __construct(array $data)
  30. {
  31. array_key_exists('uid', $data) && $this->uid = $data['uid'];
  32. array_key_exists('height', $data) && $this->height = $data['height'];
  33. array_key_exists('id', $data) && $this->pairId = $data['id'];
  34. array_key_exists('age', $data) && $this->birthDate = $data['age'];
  35. array_key_exists('match_min_age', $data) && $this->matchMinAge = $data['match_min_age'];
  36. array_key_exists('match_max_age', $data) && $this->matchMaxAge = $data['match_max_age'];
  37. array_key_exists('match_raduis', $data) && $this->matchRadius = $data['match_raduis'];
  38. array_key_exists('lng', $data) && $this->enrollLongitude = $data['lng'];
  39. array_key_exists('lat', $data) && $this->enrollLatitude = $data['lat'];
  40. array_key_exists('sxo', $data) && $this->sexualOrientation = $data['sxo'];
  41. array_key_exists('sex', $data) && $this->gender = $data['sex'];
  42. }
  43. }