ScheduleTime.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Wpae\Scheduling\Interval; |
| 4 | |
| 5 | |
| 6 | class ScheduleTime |
| 7 | { |
| 8 | private $times; |
| 9 | |
| 10 | private $monthly; |
| 11 | private $timezone; |
| 12 | |
| 13 | public function __construct($times, $monthly, $timezone) |
| 14 | { |
| 15 | $this->times = $times; |
| 16 | $this->monthly = $monthly; |
| 17 | $this->timezone = $timezone; |
| 18 | } |
| 19 | |
| 20 | public function getTime() |
| 21 | { |
| 22 | $response = array(); |
| 23 | |
| 24 | foreach ($this->times as $time) { |
| 25 | $response[] = array( |
| 26 | 'day' => $time['day'], |
| 27 | 'hour' => $time['hour'], |
| 28 | 'min' => $time['min'] |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | return $response; |
| 33 | } |
| 34 | |
| 35 | public function getTimezone() |
| 36 | { |
| 37 | return $this->timezone; |
| 38 | } |
| 39 | |
| 40 | public function isMonthly() |
| 41 | { |
| 42 | return $this->monthly; |
| 43 | } |
| 44 | } |