Date_Holidays
[ class tree: Date_Holidays ] [ index: Date_Holidays ] [ all elements ]

Class: Date_Holidays_Driver_Composite

Source Location: /Date_Holidays-0.21.8/Date/Holidays/Driver/Composite.php

Class Overview

Date_Holidays_Driver
   |
   --Date_Holidays_Driver_Composite

Composite driver - you can use this one to combine two or more drivers


Author(s):

Version:

  • CVS: $Id$

Variables

Methods


Inherited Variables

Inherited Methods

Class: Date_Holidays_Driver

Date_Holidays_Driver::Date_Holidays_Driver()
Constructor
Date_Holidays_Driver::addCompiledTranslationFile()
Add a compiled language-file's content
Date_Holidays_Driver::addDriver()
Add a driver component
Date_Holidays_Driver::addTranslation()
addTranslation
Date_Holidays_Driver::addTranslationFile()
Add a language-file's content
Date_Holidays_Driver::getHoliday()
Returns the specified holiday
Date_Holidays_Driver::getHolidayDate()
Returns date of a holiday
Date_Holidays_Driver::getHolidayDates()
Returns dates of all holidays or those accepted by the applied filter.
Date_Holidays_Driver::getHolidayForDate()
Returns a
object, if any was found, matching the specified date.
Date_Holidays_Driver::getHolidayProperties()
Returns the localized properties of a holiday. If no properties have been stored an empty array will be returned.
Date_Holidays_Driver::getHolidays()
Returns all holidays that the driver knows.
Date_Holidays_Driver::getHolidaysForDatespan()
Returns an array containing a number of
items.
Date_Holidays_Driver::getHolidayTitle()
Returns localized title for a holiday
Date_Holidays_Driver::getHolidayTitles()
Returns localized titles of all holidays or those accepted by the filter
Date_Holidays_Driver::getInternalHolidayNames()
Returns the internal names of holidays that were calculated
Date_Holidays_Driver::getISO3166Codes()
Method that returns an array containing the ISO3166 codes that may possibly identify a driver.
Date_Holidays_Driver::getYear()
Returns the driver's current year
Date_Holidays_Driver::isHoliday()
Determines whether a date represents a holiday or not
Date_Holidays_Driver::removeDriver()
Remove a driver component
Date_Holidays_Driver::setLocale()
Sets the driver's locale
Date_Holidays_Driver::setYear()
Sets the driver's current year
Date_Holidays_Driver::_addDays()
Converts the date to the specified no of days from the given date
Date_Holidays_Driver::_addHoliday()
Adds a holiday to the driver's holidays
Date_Holidays_Driver::_addStaticHolidays()
Adds all holidays in the array to the driver's internal list of holidays.
Date_Holidays_Driver::_addStringPropertiesForHoliday()
Adds a arbitrary number of localized string-properties for the specified holiday.
Date_Holidays_Driver::_addStringPropertyForHoliday()
Adds a localized (regrading translation etc.) string-property for a holiday.
Date_Holidays_Driver::_addTranslationData()
Add a language-file's content. Translations, properties, etc. for holidays will be made available with the specified locale.
Date_Holidays_Driver::_addTranslationForHoliday()
Add a localized translation for a holiday's title. Overwrites existing data.
Date_Holidays_Driver::_buildHolidays()
Build the internal arrays that contain data about the calculated holidays
Date_Holidays_Driver::_findBestLocale()
Finds the best internally available locale for the specified one
Date_Holidays_Driver::_removeHoliday()
Remove a holiday from internal storage

Class Details

[line 44]
Composite driver - you can use this one to combine two or more drivers


[ Top ]


Class Variables

$_driverName =  'Composite'

[line 52]

this driver's name
  • Access: protected

Type:   string
Overrides:   Array


[ Top ]



Method Detail

Date_Holidays_Driver_Composite (Constructor)   [line 78]

Date_Holidays_Driver_Composite Date_Holidays_Driver_Composite( )

Constructor

Use the Date_Holidays::factory() method to construct an object of a certain driver

  • Access: protected

[ Top ]

addDriver   [line 101]

boolean addDriver( object $driver)

Add a driver component
  • Return: true on success, false otherwise
  • Access: public

Overrides Date_Holidays_Driver::addDriver() (Add a driver component)

Parameters:

object   $driver   —  Date_Holidays_Driver driver-object

[ Top ]

getHoliday   [line 175]

object Date_Holidays_Holiday getHoliday( string $internalName, [string $locale = null])

Returns the specified holiday

Return format:

   array(
       'title' =>  'Easter Sunday'
       'date'  =>  '2004-04-11'
   )


Overrides Date_Holidays_Driver::getHoliday() (Returns the specified holiday)

Parameters:

string   $internalName   —  internal name of the holiday
string   $locale   —  locale setting that shall be used by this method

[ Top ]

getHolidayDate   [line 204]

object Date getHolidayDate( string $internalName)

Returns date of a holiday
  • Return: date of the holiday as PEAR::Date object on success, otherwise a PEAR_Error object
  • Throws: object PEAR_Error DATE_HOLIDAYS_INVALID_INTERNAL_NAME
  • Access: public

Overrides Date_Holidays_Driver::getHolidayDate() (Returns date of a holiday)

Parameters:

string   $internalName   —  internal name for holiday

[ Top ]

getHolidayDates   [line 233]

array getHolidayDates( [Date_Holidays_Filter $filter = null])

Returns dates of all holidays or those accepted by the specified filter.
  • Return: array with holidays' dates on success, otherwise a PEAR_ErrorStack object
  • Throws: object PEAR_ErrorStack DATE_HOLIDAYS_INVALID_INTERNAL_NAME
  • Access: public

Overrides Date_Holidays_Driver::getHolidayDates() (Returns dates of all holidays or those accepted by the applied filter.)

Parameters:

Date_Holidays_Filter   $filter   —  filter-object (or an array !DEPRECATED!)

[ Top ]

getHolidayForDate   [line 346]

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
   )
 )


Overrides Date_Holidays_Driver::getHolidayForDate() (Returns a
object, if any was found, matching the specified date.)

Parameters:

mixed   $date   —  date (timestamp | string | PEAR::Date object)
string   $locale   —  locale setting that shall be used by this method
boolean   $multiple   —  true if multiple search is required.

[ Top ]

getHolidays   [line 406]

array getHolidays( [Date_Holidays_Filter $filter = null])

Returns all holidays that were found

Return format:

   array(
       'easter' =>  array(
           'title' =>  'Easter Sunday'
           'date'  =>  '2004-04-11'
       ),
       'eastermonday'  =>  array(
           'title' =>  'Easter Monday'
           'date'  =>  '2004-04-12'
       ),
       ...
   )

  • Return: numeric array containing objects of Date_Holidays_Holiday on success, otherwise a PEAR_ErrorStack object
  • Throws: object PEAR_ErrorStack DATE_HOLIDAYS_INVALID_INTERNAL_NAME
  • Access: public

Overrides Date_Holidays_Driver::getHolidays() (Returns all holidays that the driver knows.)

Parameters:

Date_Holidays_Filter   $filter   —  filter-object (or an array !DEPRECATED!)

[ Top ]

getHolidayTitle   [line 476]

string getHolidayTitle( string $internalName, [string $locale = null])

Returns localized title for a holiday

Overrides Date_Holidays_Driver::getHolidayTitle() (Returns localized title for a holiday)

Parameters:

string   $internalName   —  internal name for holiday
string   $locale   —  locale setting that shall be used by this method

[ Top ]

getHolidayTitles   [line 508]

array getHolidayTitles( [Date_Holidays_Filter $filter = null], [string $locale = null])

Returns localized titles of all holidays or those specififed in $restrict array
  • Return: array with localized holiday titles on success, otherwise a PEAR_Error object
  • Throws: object PEAR_Error DATE_HOLIDAYS_INVALID_INTERNAL_NAME
  • Access: public

Overrides Date_Holidays_Driver::getHolidayTitles() (Returns localized titles of all holidays or those accepted by the filter)

Parameters:

Date_Holidays_Filter   $filter   —  filter-object (or an array !DEPRECATED!)
string   $locale   —  locale setting that shall be used by this method

[ Top ]

getYear   [line 577]

void 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.

This method is only available to keep abstraction working.

  • Access: public

Overrides Date_Holidays_Driver::getYear() (Returns the driver's current year)
[ Top ]

isHoliday   [line 621]

boolean isHoliday( mixed $date, [Date_Holidays_Filter $filter = null])

Determines whether a date represents a holiday or not.

The method searches all added drivers for this date, to determine whether it's a holiday.

  • Return: true if date represents a holiday, otherwise false
  • Access: public

Overrides Date_Holidays_Driver::isHoliday() (Determines whether a date represents a holiday or not)

Parameters:

mixed   $date   —  date (can be a timestamp, string or PEAR::Date object)
Date_Holidays_Filter   $filter   —  filter-object (or an array !DEPRECATED!)

[ Top ]

removeDriver   [line 125]

boolean removeDriver( object $driver)

Remove a driver component
  • Return: true on success, otherwise a PEAR_Error object
  • Throws: object PEAR_Error DATE_HOLIDAYS_DRIVER_NOT_FOUND
  • Access: public

Overrides Date_Holidays_Driver::removeDriver() (Remove a driver component)

Parameters:

object   $driver   —  Date_Holidays_Driver driver-object

[ Top ]

setLocale   [line 644]

void setLocale( string $locale)

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.

This method is only available to keep abstraction working.

  • Access: public

Overrides Date_Holidays_Driver::setLocale() (Sets the driver's locale)

Parameters:

string   $locale   —  locale

[ Top ]

setYear   [line 592]

boolean setYear( int $year)

This (re)sets the year of every driver-object in the compound.

Note that this will cause every attached driver to recalculate the holidays!

  • Return: true on success, otherwise a PEAR_ErrorStack object
  • Throws: object PEAR_ErrorStack
  • Access: public

Overrides Date_Holidays_Driver::setYear() (Sets the driver's current year)

Parameters:

int   $year   —  year

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:52:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.