| Total Complexity | 12 |
| Total Lines | 105 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class SalesPeriod |
||
| 16 | { |
||
| 17 | /** @var string[] */ |
||
| 18 | private $name; |
||
| 19 | |||
| 20 | /** @var Carbon */ |
||
| 21 | private $startDate; |
||
| 22 | |||
| 23 | /** @var Carbon */ |
||
| 24 | private $endDate; |
||
| 25 | |||
| 26 | /** @var string */ |
||
| 27 | private $salesRegulationsUrl; |
||
| 28 | |||
| 29 | /** @var string */ |
||
| 30 | private $region; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $locale |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | public function getName($locale = null) |
||
| 37 | { |
||
| 38 | if ($locale === null) { |
||
| 39 | $locale = 'en'; |
||
| 40 | } |
||
| 41 | |||
| 42 | return $this->name[$locale]; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param string $name |
||
| 47 | * @param string $locale |
||
| 48 | */ |
||
| 49 | public function setName($name, $locale = null): void |
||
| 50 | { |
||
| 51 | if ($locale === null) { |
||
| 52 | $locale = 'en'; |
||
| 53 | } |
||
| 54 | |||
| 55 | $this->name[$locale] = $name; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return Carbon |
||
| 60 | */ |
||
| 61 | public function getStartDate() |
||
| 62 | { |
||
| 63 | return $this->startDate; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param Carbon $startDate |
||
| 68 | */ |
||
| 69 | protected function setStartDate($startDate): void |
||
| 70 | { |
||
| 71 | $this->startDate = $startDate; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return Carbon |
||
| 76 | */ |
||
| 77 | public function getEndDate() |
||
| 78 | { |
||
| 79 | return $this->endDate; |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @param Carbon $endDate |
||
| 84 | */ |
||
| 85 | protected function setEndDate($endDate): void |
||
| 86 | { |
||
| 87 | $this->endDate = $endDate; |
||
| 88 | } |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @return string |
||
| 92 | */ |
||
| 93 | public function getSalesRegulationsUrl() |
||
| 96 | } |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @param string $salesRegulationsUrl |
||
| 100 | */ |
||
| 101 | public function setSalesRegulationsUrl($salesRegulationsUrl): void |
||
| 104 | } |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @return string |
||
| 108 | */ |
||
| 109 | public function getRegion() |
||
| 110 | { |
||
| 111 | return $this->region; |
||
| 112 | } |
||
| 113 | |||
| 114 | /** |
||
| 115 | * @param string $region |
||
| 116 | */ |
||
| 117 | public function setRegion($region): void |
||
| 120 | } |
||
| 121 | } |
||
| 122 |