| 1 | <?php |
||
| 19 | class Day extends PeriodAbstract implements \Iterator |
||
| 20 | { |
||
| 21 | const MONDAY = 1; |
||
| 22 | const TUESDAY = 2; |
||
| 23 | const WEDNESDAY = 3; |
||
| 24 | const THURSDAY = 4; |
||
| 25 | const FRIDAY = 5; |
||
| 26 | const SATURDAY = 6; |
||
| 27 | const SUNDAY = 0; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var PeriodInterface |
||
| 31 | */ |
||
| 32 | private $current; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Returns the period as a DatePeriod. |
||
| 36 | * |
||
| 37 | * @return \DatePeriod |
||
| 38 | */ |
||
| 39 | public function getDatePeriod() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Returns the day name (probably in english). |
||
| 46 | * |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public function __toString() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @param \DateTime $start |
||
| 56 | * |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | public static function isValid(\DateTime $start) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Returns a \DateInterval equivalent to the period. |
||
| 66 | * |
||
| 67 | * @static |
||
| 68 | * |
||
| 69 | * @return \DateInterval |
||
| 70 | */ |
||
| 71 | public static function getDateInterval() |
||
| 75 | |||
| 76 | /** |
||
| 77 | * {@inheritdoc} |
||
| 78 | */ |
||
| 79 | public function current() |
||
| 83 | |||
| 84 | /** |
||
| 85 | * {@inheritdoc} |
||
| 86 | */ |
||
| 87 | public function next() |
||
| 98 | |||
| 99 | /** |
||
| 100 | * {@inheritdoc} |
||
| 101 | */ |
||
| 102 | public function key() |
||
| 106 | |||
| 107 | /** |
||
| 108 | * {@inheritdoc} |
||
| 109 | */ |
||
| 110 | public function valid() |
||
| 114 | |||
| 115 | /** |
||
| 116 | * {@inheritdoc} |
||
| 117 | */ |
||
| 118 | public function rewind() |
||
| 123 | } |
||
| 124 |