| 1 | <?php |
||
| 14 | class Week implements Entity, IteratorAggregate |
||
| 15 | { |
||
| 16 | /** @var int */ |
||
| 17 | private $weekNumber; |
||
| 18 | |||
| 19 | /** @var array */ |
||
| 20 | private $days = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Week constructor. |
||
| 24 | * @param $weekNumber |
||
| 25 | */ |
||
| 26 | public function __construct($weekNumber) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param \stdClass $jsonObject |
||
| 33 | * @return Week |
||
| 34 | */ |
||
| 35 | public static function fromJson(\stdClass $jsonObject): self |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return int |
||
| 49 | */ |
||
| 50 | public function getWeekNumber(): int |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param Day $day |
||
| 57 | */ |
||
| 58 | public function addDay(Day $day): void |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param int $dayOfWeek |
||
| 65 | * @return Day |
||
| 66 | * @throws DayNotFoundException |
||
| 67 | */ |
||
| 68 | public function getDay(int $dayOfWeek): Day |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Retrieve an external iterator |
||
| 79 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
| 80 | * @return Traversable An instance of an object implementing <b>Iterator</b> or |
||
| 81 | * <b>Traversable</b> |
||
| 82 | * @since 5.0.0 |
||
| 83 | */ |
||
| 84 | public function getIterator() |
||
| 88 | } |