1 | <?php |
||
24 | abstract class HolidayFactory |
||
25 | { |
||
26 | /** |
||
27 | * Registered providers. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected static $providers = array( |
||
32 | 'PL' => 'Poland', |
||
33 | 'DK' => 'Denmark', |
||
34 | ); |
||
35 | |||
36 | /** |
||
37 | * Returns array with registered providers. |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | 4 | public static function getProviders() |
|
45 | |||
46 | /** |
||
47 | * Registers a holidays provider class. |
||
48 | * |
||
49 | * @param string $countryCode Country code |
||
50 | * @param string $providerClassName Provider class name |
||
51 | */ |
||
52 | 7 | public static function registerProvider($countryCode, $providerClassName) |
|
59 | |||
60 | /** |
||
61 | * Unregisters a holidays provider class. |
||
62 | * |
||
63 | * @param string $providerClassName Country code of the provider or the provider class name |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | 4 | public static function unregisterProvider($providerClassName) |
|
84 | |||
85 | /** |
||
86 | * Creates a holidays provider based on $countryCode code. |
||
87 | * |
||
88 | * @param string $countryCode ISO Country Code, County Name or provider class name |
||
89 | * @param null|DateTimeZone $timezone (optional) Time zone |
||
90 | * |
||
91 | * @throws InvalidArgumentException |
||
92 | * |
||
93 | * @return Provider\AbstractProvider |
||
94 | */ |
||
95 | 36 | public static function createProvider($countryCode, DateTimeZone $timezone = null) |
|
131 | } |
||
132 |