1 | <?php |
||
7 | class WeekDay extends Enum |
||
8 | { |
||
9 | const MONDAY = 'Monday'; |
||
10 | const TUESDAY = 'Tuesday'; |
||
11 | const WEDNESDAY = 'Wednesday'; |
||
12 | const THURSDAY = 'Thursday'; |
||
13 | const FRIDAY = 'Friday'; |
||
14 | const SATURDAY = 'Saturday'; |
||
15 | const SUNDAY = 'Sunday'; |
||
16 | |||
17 | /** |
||
18 | * Returns the current week day. |
||
19 | * |
||
20 | * @return WeekDay |
||
21 | */ |
||
22 | 1 | public static function now() |
|
28 | |||
29 | /** |
||
30 | * Returns a WeekDay from a PHP native \DateTime |
||
31 | * |
||
32 | * @param \DateTime $date |
||
33 | * @return WeekDay |
||
34 | */ |
||
35 | 2 | public static function fromNativeDateTime(\DateTime $date) |
|
41 | |||
42 | /** |
||
43 | * Returns a numeric representation of the WeekDay. |
||
44 | * 1 for Monday to 7 for Sunday. |
||
45 | * |
||
46 | * @return int |
||
47 | */ |
||
48 | 1 | public function getNumericValue() |
|
52 | } |
||
53 |
This method has been deprecated.