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

Source for file Austria.php

Documentation is available at Austria.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. /**
  4.  * Driver for holidays in Austria
  5.  *
  6.  * PHP Version 4
  7.  *
  8.  * Copyright (c) 1997-2008 The PHP Group
  9.  *
  10.  * This source file is subject to version 3.0 of the PHP license,
  11.  * that is bundled with this package in the file LICENSE, and is
  12.  * available at through the world-wide-web at
  13.  * http://www.php.net/license/3_01.txt.
  14.  * If you did not receive a copy of the PHP license and are unable to
  15.  * obtain it through the world-wide-web, please send a note to
  16.  * license@php.net so we can mail you a copy immediately.
  17.  *
  18.  * @category Date
  19.  * @package  Date_Holidays
  20.  * @author   Stephan Schmidt <schst@php-tools.net>
  21.  * @author   Carsten Lucke <luckec@tool-garage.de>
  22.  * @license  http://www.php.net/license/3_01.txt PHP License 3.0.1
  23.  * @version  CVS: $Id: Austria.php,v 1.7 2008/03/17 11:37:49 kguest Exp $
  24.  * @link     http://pear.php.net/package/Date_Holidays
  25.  */
  26.  
  27. /**
  28.  * Requires Christian driver
  29.  */
  30. require_once 'Date/Holidays/Driver/Christian.php';
  31.  
  32. /**
  33.  * class that calculates Austrian holidays
  34.  *
  35.  * @category   Date
  36.  * @package    Date_Holidays
  37.  * @author     Klemens Ullmann <klemens@ull.at>
  38.  * @subpackage Driver
  39.  * @license    http://www.php.net/license/3_01.txt PHP License 3.0.1
  40.  * @version    CVS: $Id: Austria.php,v 1.7 2008/03/17 11:37:49 kguest Exp $
  41.  * @link       http://pear.php.net/package/Date_Holidays
  42.  */
  43. {
  44.     /**
  45.      * Constructor
  46.      *
  47.      * Use the Date_Holidays::factory() method to construct an object of a certain
  48.      * driver
  49.      *
  50.      * @access   protected
  51.      */
  52.     function Date_Holidays_Driver_Austria()
  53.     {
  54.     }
  55.  
  56.     /**
  57.      * Build the internal arrays that contain data about the calculated holidays
  58.      *
  59.      * @access   protected
  60.      * @return   boolean true on success, otherwise a PEAR_ErrorStack object
  61.      * @throws   object PEAR_ErrorStack
  62.      */
  63.     function _buildHolidays()
  64.     {
  65.         /**
  66.          * New Year's Day
  67.          */
  68.         $this->_addHoliday('newYearsDay'$this->_year . '-01-01''Neujahr');
  69.  
  70.         /**
  71.          * Epiphanias
  72.          */
  73.         $this->_addHoliday('epiphany',
  74.                            $this->_year . '-01-06',
  75.                            'Heilige Drei Könige');
  76.  
  77.         /**
  78.          * Easter Sunday
  79.          */
  80.         $easterDate Date_Holidays_Driver_Christian::calcEaster($this->_year);
  81.         $this->_addHoliday('easter'$easterDate'Ostersonntag');
  82.  
  83.         /**
  84.          * Easter Monday
  85.          */
  86.         $this->_addHoliday('easterMonday'$easterDate->getNextDay()'Ostermontag');
  87.  
  88.         /**
  89.          * Day of Work
  90.          */
  91.         $this->_addHoliday('dayOfWork'$this->_year . '-05-01''Tag der Arbeit');
  92.  
  93.         /**
  94.          * Whitsun (determines Whit Monday, Ascension Day and
  95.          * Feast of Corpus Christi)
  96.          */
  97.         $whitsunDate = new Date($easterDate);
  98.         $whitsunDate->addSpan(new Date_Span('49, 0, 0, 0'));
  99.         $this->_addHoliday('whitsun'$whitsunDate'Pfingstsonntag');
  100.  
  101.         /**
  102.          * Ascension Day
  103.          */
  104.         $ascensionDayDate = new Date($whitsunDate);
  105.         $ascensionDayDate->subtractSpan(new Date_Span('10, 0, 0, 0'));
  106.         $this->_addHoliday('ascensionDay',
  107.                            $ascensionDayDate,
  108.                            'Christi Himmelfahrt');
  109.  
  110.         /**
  111.          * Whit Monday
  112.          */
  113.         $this->_addHoliday('whitMonday',
  114.                            $whitsunDate->getNextDay(),
  115.                            'Pfingstmontag');
  116.  
  117.         /**
  118.          * Feast of Corpus Christi
  119.          */
  120.         $corpusChristiDate = new Date($whitsunDate);
  121.         $corpusChristiDate->addSpan(new Date_Span('11, 0, 0, 0'));
  122.         $this->_addHoliday('corpusChristi',
  123.                            $corpusChristiDate,
  124.                            'Fronleichnam');
  125.  
  126.         /**
  127.          * Ascension of Maria
  128.          */
  129.         $this->_addHoliday('mariaAscension',
  130.                            $this->_year . '-08-15',
  131.                            'Maria Himmelfahrt');
  132.  
  133.         /**
  134.          * Österreichischer Nationalfeiertag
  135.          */
  136.         $this->_addHoliday('nationalDayAustria',
  137.                            $this->_year . '-10-26',
  138.                            'Österreichischer Nationalfeiertag');
  139.  
  140.         /**
  141.          * All Saints' Day
  142.          */
  143.         $this->_addHoliday('allSaintsDay',
  144.                            $this->_year . '-11-01',
  145.                            'Allerheiligen');
  146.  
  147.         /**
  148.          * Christmas day
  149.          */
  150.         $this->_addHoliday('christmasDay',
  151.                            $this->_year . '-12-25',
  152.                            '1. Weihnachtsfeiertag');
  153.  
  154.         /**
  155.          * Boxing day
  156.          */
  157.         $this->_addHoliday('boxingDay',
  158.                            $this->_year . '-12-26',
  159.                            '2. Weihnachtsfeiertag');
  160.  
  161.  
  162.         if (Date_Holidays::errorsOccurred()) {
  163.             return Date_Holidays::getErrorStack();
  164.         }
  165.         return true;
  166.     }
  167.  
  168.     /**
  169.      * Method that returns an array containing the ISO3166 codes that may possibly
  170.      * identify a driver.
  171.      *
  172.      * @static
  173.      * @access public
  174.      * @return array possible ISO3166 codes
  175.      */
  176.     function getISO3166Codes()
  177.     {
  178.         return array('at');
  179.     }
  180. }
  181. ?>

Documentation generated on Thu, 10 Apr 2008 20:00:07 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.