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

Source for file Holiday.php

Documentation is available at Holiday.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors:   Carsten Lucke <luckec@tool-garage.de>                     |
  17. // +----------------------------------------------------------------------+
  18. //
  19. //    $Id: Holiday.php,v 1.6 2004/07/30 21:26:55 luckec Exp $
  20.  
  21. /**
  22.  * Simple class that wraps a holiday's data
  23.  *
  24.  * @category Date
  25.  * @package  Date_Holidays
  26.  * @version  $Id: Holiday.php,v 1.6 2004/07/30 21:26:55 luckec Exp $
  27.  * @author   Carsten Lucke <luckec@tool-garage.de>
  28.  */
  29. {
  30.    /**
  31.     * Internal name
  32.     *
  33.     * @access   public
  34.     * @var      string 
  35.     */
  36.     var $internalName;
  37.     
  38.    /**
  39.     * Title
  40.     *
  41.     * @access   public
  42.     * @var      string 
  43.     */
  44.     var $title;
  45.     
  46.    /**
  47.     * Date
  48.     *
  49.     * @access   public
  50.     * @var      object Date 
  51.     */
  52.     var $date;
  53.     
  54.    /**
  55.     * Constructor
  56.     *
  57.     * @access   public
  58.     * @param    string      $internalName   internal name
  59.     * @param    string      $title          title
  60.     * @param    object Date $date           date
  61.     */
  62.     function Date_Holidays_Holiday($internalName$title&$date)
  63.     {
  64.         $this->internalName = $internalName;
  65.         $this->title        = $title;
  66.         $this->date         = &$date;
  67.     }
  68.     
  69.    /**
  70.     * Returns the internal name
  71.     *
  72.     * @access   public
  73.     * @return   string  internal name
  74.     */
  75.     function getInternalName()
  76.     {
  77.         return $this->internalName;
  78.     }
  79.     
  80.    /**
  81.     * Returns the title
  82.     *
  83.     * @access   public
  84.     * @return   string  title
  85.     */
  86.     function getTitle()
  87.     {
  88.         return $this->title;
  89.     }
  90.     
  91.    /**
  92.     * Returns the date
  93.     *
  94.     * @access   public
  95.     * @return   object Date date
  96.     */
  97.     function getDate()
  98.     {
  99.         return $this->date;
  100.     }
  101.     
  102.    /**
  103.     * Set the internal name
  104.     *
  105.     * @access   public
  106.     * @param    string  $internalName   internal name
  107.     */
  108.     function setInternalName($internalName)
  109.     {
  110.         $this->internalName = $internalName;
  111.     }
  112.     
  113.    /**
  114.     * Set the title
  115.     *
  116.     * @access   public
  117.     * @param    string  $title  title
  118.     */
  119.     function setTitle($title)
  120.     {
  121.         $this->title = $title;
  122.     }
  123.     
  124.    /**
  125.     * Set the date
  126.     *
  127.     * @access   public
  128.     * @param    object Date date
  129.     */
  130.     function setDate(&$date)
  131.     {
  132.         $this->date = &$date;
  133.     }
  134.     
  135.    /**
  136.     * Returns the holiday data as an array.
  137.     *
  138.     * Format:
  139.     * <pre>
  140.     *   array(
  141.     *       'internalName'  => 'easter'
  142.     *       'title'         => 'Easter Sunday'
  143.     *       'date'          => Object of type Date
  144.     *   )
  145.     * </pre>
  146.     * 
  147.     * @access   public
  148.     * @return   array   holiday-data
  149.     */
  150.     function toArray()
  151.     {
  152.         $data                   = array();
  153.         $data['internalName']   $this->internalName;
  154.         $data['title']          $this->title;
  155.         $data['date']           &$this->date;
  156.         return $data;
  157.     }
  158. }
  159. ?>

Documentation generated on Mon, 11 Mar 2019 13:54:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.