BonusItem.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Game\BetBy;
  3. class BonusItem
  4. {
  5. public $id;
  6. public $templateId;
  7. public $name;
  8. public $type;
  9. public $playerId;
  10. public $externalPlayerId;
  11. public $brandId;
  12. public $eventScheduled;
  13. public $receiptDate;
  14. public $issueType;
  15. public $restrictions;
  16. public $viewed;
  17. public $activationDate;
  18. public $endingDate;
  19. public $status;
  20. public $fromTime;
  21. public $toTime;
  22. public $freebetData;
  23. public $comboboostData;
  24. public function __construct(array $data)
  25. {
  26. $this->id = $data['id'];
  27. $this->templateId = $data['template_id'];
  28. $this->name = $data['name'];
  29. $this->type = $data['type'];
  30. $this->playerId = $data['player_id'];
  31. $this->externalPlayerId = $data['external_player_id'];
  32. $this->brandId = $data['brand_id'];
  33. $this->eventScheduled = $data['event_scheduled'];
  34. $this->receiptDate = $data['receipt_date'];
  35. $this->issueType = $data['issue_type'];
  36. $this->restrictions = array_map(function($restriction) {
  37. return new RestrictionItem($restriction);
  38. }, $data['restrictions'] ?? []);
  39. $this->viewed = $data['viewed'];
  40. $this->activationDate = $data['activation_date'];
  41. $this->endingDate = $data['ending_date'];
  42. $this->status = $data['status'];
  43. $this->fromTime = $data['from_time'];
  44. $this->toTime = $data['to_time'];
  45. $this->freebetData = $data['freebet_data'] ? new FreebetDataItem($data['freebet_data']) : null;
  46. $this->comboboostData = $data['comboboost_data'] ? new ComboboostDataItem($data['comboboost_data']) : null;
  47. }
  48. }