/**
  * Constructor.
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'goodFriday', 'easterMonday', 'dayOfWork', 'ascensionDay', 'whitMonday', 'germanUnificationDay', 'reformationDay', 'christmasDay', 'boxingDay'));
 }
예제 #2
0
 /**
  * Returns dates of all holidays or those accepted by the applied filter.
  *
  * Structure of the returned array:
  * <pre>
  * array(
  *   'internalNameFoo' => object of type date,
  *   'internalNameBar' => object of type date
  * )
  * </pre>
  *
  * @param Date_Holidays_Filter $filter filter-object (or an array !DEPRECATED!)
  *
  * @access   public
  * @return   array with holidays' dates on success, otherwise a PEAR_Error object
  * @throws   object PEAR_Error   DATE_HOLIDAYS_INVALID_INTERNAL_NAME
  * @uses     getHolidayDate()
  */
 function getHolidayDates($filter = null)
 {
     if (is_null($filter)) {
         $filter = new Date_Holidays_Filter_Blacklist(array());
     } elseif (is_array($filter)) {
         $filter = new Date_Holidays_Filter_Whitelist($filter);
     }
     $dates = array();
     foreach ($this->_internalNames as $internalName) {
         if ($filter->accept($internalName)) {
             $date = $this->getHolidayDate($internalName);
             if (Date_Holidays::isError($date)) {
                 return $date;
             }
             $dates[$internalName] = $this->getHolidayDate($internalName);
         }
     }
     return $dates;
 }
예제 #3
0
 /**
  * Constructor.
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'epiphany', 'goodFriday', 'easterMonday', 'dayOfWork', 'ascensionDay', 'whitMonday', 'corpusChristi', 'germanUnificationDay', 'allSaintsDay', 'christmasDay', 'boxingDay'));
 }
예제 #4
0
 /**
  * Constructor.
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'queenDay', 'goodFriday', 'easterMonday', 'whitMonday', 'ascensionDay', 'secondChristmasDay'));
 }
예제 #5
0
 /**
  * Constructor.
  *
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'carnival', 'goodFriday', 'easter', 'libertyDayPortugal', 'dayOfWork', 'corpusChristi', 'nationalDayPortugal', 'mariaAscension', 'republicDayPortugal', 'allSaintsDay', 'independenceOfPortugal', 'immaculateConceptionDay', 'christmasDay'));
 }
예제 #6
0
 /**
  * Constructor.
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'newYearsDayHoliday', 'dayAfterNewYearsDay', 'waitangiDay', 'goodFriday', 'easterMonday', 'anzacDay', 'queensBirthday', 'labourDay', 'christmasDay', 'boxingDay', 'christmasDayHoliday', 'boxingDayHoliday'));
 }
예제 #7
0
 /**
  * Returns localized titles of all holidays or those specififed in
  * $restrict array
  *
  * @param Date_Holidays_Filter $filter filter-object
  *                                      (or an array !DEPRECATED!)
  * @param string               $locale locale setting that shall be used by
  *                                      this method
  *
  * @access   public
  * @return   array   array with localized holiday titles on success,
  *                      otherwise a PEAR_Error object
  * @throws   object PEAR_Error   DATE_HOLIDAYS_INVALID_INTERNAL_NAME
  */
 function getHolidayTitles($filter = null, $locale = null)
 {
     if (is_null($filter)) {
         $filter = new Date_Holidays_Filter_Blacklist(array());
     } elseif (is_array($filter)) {
         $filter = new Date_Holidays_Filter_Whitelist($filter);
     }
     $errorStack =& Date_Holidays::getErrorStack();
     $titles = array();
     $notFound = array();
     foreach ($this->_internalNames as $internalName) {
         // check if the filter permits further processing
         if (!$filter->accept($internalName)) {
             continue;
         }
         foreach ($this->_driverIds as $id) {
             $title = $this->_drivers[$id]->getHolidayTitle($internalName, $locale);
             if (Date_Holidays::isError($title)) {
                 /**
                  * current driver doesn't have this internalName, trying next
                  * driver
                  */
                 array_push($notFound, $internalName);
                 continue;
             }
             /**
              * internal name found in highest priorized driver, stepping to
              * next internal name checks if internal name is existent in
              * $notFound array and unsets this entry as it has been found now
              */
             $notFound = array_unique($notFound);
             if (in_array($internalName, $notFound)) {
                 unset($notFound[array_search($internalName, $notFound)]);
             }
             $titles[$internalName] = $title;
             continue 2;
         }
     }
     if (!empty($notFound)) {
         foreach ($notFound as $internalName) {
             $errorStack->push(DATE_HOLIDAYS_INVALID_INTERNAL_NAME, 'error', array(), 'Invalid internal name: ' . $internalName, false, debug_backtrace());
         }
     }
     if ($errorStack->hasErrors() && !empty($notFound)) {
         return $errorStack;
     }
     return $titles;
 }
예제 #8
0
 /**
  * Constructor.
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'epiphanySunday', 'easter', 'easterMonday', 'whitsun', 'whitMonday', 'dayOfWork', 'victory1945', 'ascensionDay', 'mothersDay', 'frenchNationalDay', 'mariaAscension', 'allSaintsDay', 'veteransDay', 'christmasDay'));
 }
예제 #9
0
 /**
  * Constructor.
  *
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'epiphany', 'easterMonday', 'dayOfWork', 'ascensionDate', 'whitsun', 'corpusChristi', 'mariaAscension', 'nationalDayAustria', 'allSaintsDay', 'immaculateConceptionDay', 'christmasDay', 'boxingDay'));
 }
예제 #10
0
 /**
  * Constructor.
  *
  */
 function __construct()
 {
     parent::__construct(array('newYearsDay', 'stPatricksDay', 'easterMonday', 'mayDayBankHoliday', 'juneBankHoliday', 'augustBankHoliday', 'octoberBankHoliday', 'christmasDay', 'boxingDay'));
 }