TemplateItem.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Game\BetBy;
  3. class TemplateItem
  4. {
  5. public $id;
  6. public $name;
  7. public $isActive;
  8. public $maxBonusNumber;
  9. public $type;
  10. public $operatorId;
  11. public $eventScheduled;
  12. public $brandId;
  13. public $fromTime;
  14. public $toTime;
  15. public $daysToUse;
  16. /**
  17. * @var RestrictionItem[]
  18. */
  19. public $restrictions;
  20. /**
  21. * @var FreebetDataItem|null
  22. */
  23. public $freebetData;
  24. /**
  25. * @var ComboboostDataItem|null
  26. */
  27. public $comboboostData;
  28. public $descriptions;
  29. public function __construct(array $data)
  30. {
  31. $this->id = $data['id'];
  32. $this->name = $data['name'];
  33. $this->isActive = $data['is_active'];
  34. $this->maxBonusNumber = $data['max_bonus_number'];
  35. $this->type = $data['type'];
  36. $this->operatorId = $data['operator_id'];
  37. $this->eventScheduled = $data['event_scheduled'];
  38. $this->brandId = $data['brand_id'];
  39. $this->fromTime = $data['from_time'];
  40. $this->toTime = $data['to_time'];
  41. $this->daysToUse = $data['days_to_use'];
  42. $this->restrictions = array_map(function($restriction) {
  43. return new RestrictionItem($restriction);
  44. }, $data['restrictions']['restriction_events'] ?? []);
  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. $this->descriptions = $data['descriptions'];
  48. }
  49. }