svn: /pear/packages/Date_Holidays/trunk/Date/Holidays/Driver/ AustraliaSA.php
| From: | Ken Guest | Date: | Mon, 28 Feb 2011 21:46:27 +0000 |
| Subject: | svn: /pear/packages/Date_Holidays/trunk/Date/Holidays/Driver/ AustraliaSA.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-61316@lists.php.net to get a copy of this message | ||
kguest Mon, 28 Feb 2011 21:46:27 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308776
Log:
Australia SA [component] driver
Changed paths:
A pear/packages/Date_Holidays/trunk/Date/Holidays/Driver/AustraliaSA.php
Added: pear/packages/Date_Holidays/trunk/Date/Holidays/Driver/AustraliaSA.php
===================================================================
--- pear/packages/Date_Holidays/trunk/Date/Holidays/Driver/AustraliaSA.php
(rev 0)
+++ pear/packages/Date_Holidays/trunk/Date/Holidays/Driver/AustraliaSA.php 2011-02-28 21:46:27 UTC
(rev 308776)
@@ -0,0 +1,83 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4: */
+/**
+ * This file contains only the Driver class for determining holidays in Western
+ * Australia.
+ *
+ * PHP Version 4
+ *
+ * Copyright (c) 1997-2008 The PHP Group
+ *
+ * This source file is subject to version 3.0 of the PHP license,
+ * that is bundled with this package in the file LICENSE, and is
+ * available at through the world-wide-web at
+ * http://www.php.net/license/3_01.txt.
+ * If you did not receive a copy of the PHP license and are unable to
+ * obtain it through the world-wide-web, please send a note to
+ * license@php.net so we can mail you a copy immediately.
+ *
+ * @category Date
+ * @package Date_Holidays
+ * @author Sam Wilson <sam@archives.org.au>
+ * @license http://www.php.net/license/3_01.txt
PHP License 3.0.1
+ * @link http://pear.php.net/package/Date_Holidays
+ */
+
+require_once 'Date/Calc.php';
+
+/**
+ * This Driver class calculates holidays in Western Australia. It should be used in
+ * conjunction with the Australia driver.
+ *
+ * @category Date
+ * @package Date_Holidays
+ * @subpackage Driver
+ * @author Sam Wilson <sam@archives.org.au>
+ * @license http://www.php.net/license/3_01.txt PHP License 3.0.1
+ * @link http://pear.php.net/package/Date_Holidays
+ */
+class Date_Holidays_Driver_AustraliaSA extends Date_Holidays_Driver
+{
+ /**
+ * this driver's name
+ *
+ * @access protected
+ * @var string
+ */
+ var $_driverName = 'AustraliaSA';
+
+ /**
+ * Constructor
+ *
+ * @access protected
+ */
+ function Date_Holidays_Driver_AustraliaSA()
+ {
+ }
+
+ /**
+ * Build the internal arrays that contain data about holidays.
+ *
+ * @access protected
+ * @return boolean true on success, otherwise a PEAR_ErrorStack object
+ * @throws object PEAR_ErrorStack
+ */
+ function _buildHolidays()
+ {
+ parent::_buildHolidays();
+
+ /*
+ * Labour Day - 1st Monday of October
+ */
+ $labourDay = Date_Calc::nWeekdayOfMonth(1, 1, 10, $this->_year);
+ $this->_addHoliday('labourDay', $labourDay, "Labour Day");
+
+ /*
+ * See http://en.wikipedia.org/wiki/Queen%27s_Official_Birthday#Australia
+ */
+ $foundationDay = Date_Calc::nWeekdayOfMonth(2, 1, 6, $this->_year);
+ $this->_addHoliday('queensBirthday', $foundationDay, "Queen's
Birthday");
+
+ } // _buildHolidays()
+
+} // Date_Holidays_Driver_AustraliaSA