Class: Date_Holidays_Driver
Source Location: /Date_Holidays-0.21.8/Date/Holidays/Driver.php
class that helps you to locate holidays for a year
Author(s):
Version:
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
Date_Holidays_Driver (Constructor) [line 220]
Date_Holidays_Driver Date_Holidays_Driver(
)
|
|
Constructor Use the Date_Holidays::factory() method to construct an object of a certain driver
addCompiledTranslationFile [line 1049]
boolean addCompiledTranslationFile(
string
$file, string
$locale)
|
|
Add a compiled language-file's content The language-file's content will be unserialized and translations, properties, etc. for holidays will be made available with the specified locale.
Parameters:
addDriver [line 287]
addTranslation [line 302]
boolean addTranslation(
string
$locale)
|
|
addTranslation Search for installed language files appropriate for the specified locale and add them to the driver
Parameters:
addTranslationFile [line 1012]
boolean addTranslationFile(
string
$file, string
$locale)
|
|
Add a language-file's content The language-file's content will be parsed and translations, properties, etc. for holidays will be made available with the specified locale.
Parameters:
getHoliday [line 588]
Returns the specified holiday Return format: array(
'title' => 'Easter Sunday'
'date' => '2004-04-11'
)
Overridden in child classes as:
- Date_Holidays_Driver_Composite::getHoliday()
- Returns the specified holiday
Parameters:
getHolidayDate [line 1179]
getHolidayDates [line 1214]
Returns dates of all holidays or those accepted by the applied filter. Structure of the returned array: array(
'internalNameFoo' => object of type date,
'internalNameBar' => object of type date
)
Overridden in child classes as:
- Date_Holidays_Driver_Composite::getHolidayDates()
- Returns dates of all holidays or those accepted by the specified filter.
Parameters:
getHolidayForDate [line 692]
object object getHolidayForDate(
mixed
$date, [string
$locale = null], [boolean
$multiple = false])
|
|
Returns a
object, if any was found, matching the specified date. Normally the method will return the object of the first holiday matching the date. If you want the method to continue searching holidays for the specified date, set the 4th param to true. If multiple holidays match your date, the return value will be an array containing a number of
items.
Overridden in child classes as:
- Date_Holidays_Driver_Composite::getHolidayForDate()
- Returns the title of the holiday, if any was found, matching the specified date.
Parameters:
getHolidayProperties [line 489]
array getHolidayProperties(
string
$internalName, [string
$locale = null])
|
|
Returns the localized properties of a holiday. If no properties have been stored an empty array will be returned.
Parameters:
getHolidays [line 539]
Returns all holidays that the driver knows. You can limit the holidays by passing a filter, then only those holidays accepted by the filter will be returned. Return format: array(
'easter' => object of type Date_Holidays_Holiday,
'eastermonday' => object of type Date_Holidays_Holiday,
...
)
Overridden in child classes as:
- Date_Holidays_Driver_Composite::getHolidays()
- Returns all holidays that were found
Parameters:
getHolidaysForDatespan [line 755]
array getHolidaysForDatespan(
mixed
$start, mixed
$end, [Date_Holidays_Filter
$filter = null], [string
$locale = null])
|
|
Returns an array containing a number of
items. If no items have been found the returned array will be empty.
Parameters:
getHolidayTitle [line 444]
getHolidayTitles [line 410]
getInternalHolidayNames [line 392]
array getInternalHolidayNames(
)
|
|
Returns the internal names of holidays that were calculated
getISO3166Codes [line 232]
Method that returns an array containing the ISO3166 codes that may possibly identify a driver.
getYear [line 261]
Returns the driver's current year
Overridden in child classes as:
- Date_Holidays_Driver_Composite::getYear()
- Using this method doesn't affect anything. If you have been able to add your driver to this compound, you should also be able to directly execute this action.
isHoliday [line 629]
removeDriver [line 382]
setLocale [line 1244]
void setLocale(
string
$locale)
|
|
Sets the driver's locale
Overridden in child classes as:
- Date_Holidays_Driver_Composite::setLocale()
- Using this method doesn't affect anything. If you have bben able to add your driver to this compound you should also be able to directly execute this action.
Parameters:
setYear [line 249]
boolean setYear(
int
$year)
|
|
Sets the driver's current year Calling this method forces the object to rebuild the holidays
Overridden in child classes as:
- Date_Holidays_Driver_Composite::setYear()
- This (re)sets the year of every driver-object in the compound.
Parameters:
_addDays [line 1390]
Date _addDays(
Date
$date, int
$pn_days)
|
|
Converts the date to the specified no of days from the given date To subtract days use a negative value for the '$pn_days' parameter
Parameters:
_addHoliday [line 890]
void _addHoliday(
string
$internalName, mixed
$date, string
$title)
|
|
Adds a holiday to the driver's holidays
Parameters:
_addStaticHolidays [line 869]
void _addStaticHolidays(
array
$holidays)
|
|
Adds all holidays in the array to the driver's internal list of holidays. Format of the array: array(
'newYearsDay' => array(
'date' => '01-01',
'title' => 'New Year\'s Day',
'translations' => array(
'de_DE' => 'Neujahr',
'en_EN' => 'New Year\'s Day'
)
),
'valentinesDay' => array(
...
)
);
Parameters:
_addStringPropertiesForHoliday [line 986]
boolean _addStringPropertiesForHoliday(
string
$internalName, string
$locale, array
$properties)
|
|
Adds a arbitrary number of localized string-properties for the specified holiday.
Parameters:
_addStringPropertyForHoliday [line 949]
boolean _addStringPropertyForHoliday(
string
$internalName, string
$locale, string
$propId, mixed
$propVal)
|
|
Adds a localized (regrading translation etc.) string-property for a holiday. Overwrites existing data.
Parameters:
_addTranslationData [line 1081]
boolean _addTranslationData(
array
$data, string
$locale)
|
|
Add a language-file's content. Translations, properties, etc. for holidays will be made available with the specified locale.
Parameters:
_addTranslationForHoliday [line 920]
true _addTranslationForHoliday(
string
$internalName, string
$locale, string
$title)
|
|
Add a localized translation for a holiday's title. Overwrites existing data.
Parameters:
_buildHolidays [line 274]
_findBestLocale [line 1150]
string _findBestLocale(
string
$locale)
|
|
Finds the best internally available locale for the specified one
Parameters:
_removeHoliday [line 1118]
boolean _removeHoliday(
$string
$internalName)
|
|
Remove a holiday from internal storage This method should be used within driver classes to unset holidays that were inherited from parent-drivers
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:52:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|