Class: Date_Holidays_Driver
Source Location: /Date_Holidays-0.10.0/Holidays/Driver.php
class that helps you to locate holidays for a year
Author(s):
Version:
- $Id: Driver.php,v 1.23 2004/08/30 17:33:26 luckec Exp $
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
Date_Holidays_Driver (Constructor) [line 140]
Date_Holidays_Driver Date_Holidays_Driver(
)
|
|
Constructor Use the Date_Holidays::factory() method to construct an object of a certain driver
addDriver [line 193]
addTranslationFile [line 577]
boolean addTranslationFile(
string
$file, string
$locale)
|
|
Add a translation-file's content The translation-file's content will be parsed and translations for holidays will be made available with the specified locale.
Parameters:
getHoliday [line 337]
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 662]
getHolidayDates [line 693]
array getHolidayDates(
[array
$restrict = array()])
|
|
Returns dates of all holidays or those specififed in $restrict array 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 specififed in $restrict array
Parameters:
getHolidayForDate [line 423]
object object getHolidayForDate(
mixed
$date, [string
$locale = null], [boolean
$multiple = false])
|
|
Returns the title of the holiday, if any was found, matching the specified date. Normally the method will return the title/data for the first holiday matching the date. If you want the mthod 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 of the titles/data.
array(
array(
'title' => 'New Year',
'date' => Object of type Date
),
array(
'title' => 'Circumcision of Jesus',
'date' => Object of type Date
)
)
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:
getHolidays [line 302]
array getHolidays(
[array
$restrict = array()])
|
|
Returns all holidays that the driver knows. You can limit the holidays by setting the $restrict array, then only those will be returned, whose internal name occurrs in this array. 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:
getHolidayTitle [line 257]
getHolidayTitles [line 231]
array getHolidayTitles(
[array
$restrict = array()], [string
$locale = null])
|
|
Returns localized titles of all holidays or those specififed in $restrict array
Overridden in child classes as:
- Date_Holidays_Driver_Composite::getHolidayTitles()
- Returns localized titles of all holidays or those specififed in $restrict array
Parameters:
getInternalHolidayNames [line 216]
getYear [line 167]
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 bben able to add your driver to this compound, you should also be able to directly execute this action.
isHoliday [line 368]
boolean isHoliday(
mixed
$date, [array
$restrict = array()])
|
|
Determines whether a date represents a holiday or not
Overridden in child classes as:
- Date_Holidays_Driver_Composite::isHoliday()
- Determines whether a date represents a holiday or not.
Parameters:
removeDriver [line 206]
setLocale [line 716]
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 155]
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()
- 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:
_addHoliday [line 530]
void _addHoliday(
string
$internalName, mixed
$date, string
$title)
|
|
Adds a holiday to the driver's holidays
Parameters:
_addStaticHolidays [line 514]
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:
_addTranslationForHoliday [line 551]
true _addTranslationForHoliday(
string
$internalName, string
$locale, string
$title)
|
|
Add a localized translation for a holiday's title
Parameters:
_buildHolidays [line 180]
_findBestLocale [line 636]
string _findBestLocale(
string
$locale)
|
|
Finds the best internally available locale for the specified one
Parameters:
_removeHoliday [line 606]
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, 30 Aug 2004 14:20:10 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.
|
|