File indexing completed on 2025-03-02 05:29:26

0001 <?php
0002 
0003 /**
0004  * Zend Framework
0005  *
0006  * LICENSE
0007  *
0008  * This source file is subject to the new BSD license that is bundled
0009  * with this package in the file LICENSE.txt.
0010  * It is also available through the world-wide-web at this URL:
0011  * http://framework.zend.com/license/new-bsd
0012  * If you did not receive a copy of the license and are unable to
0013  * obtain it through the world-wide-web, please send an email
0014  * to license@zend.com so we can send you a copy immediately.
0015  *
0016  * @category   Zend
0017  * @package    Zend_Gdata
0018  * @subpackage Calendar
0019  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  * @version    $Id$
0022  */
0023 
0024 /**
0025  * @see Zend_Gdata_Entry
0026  */
0027 // require_once 'Zend/Gdata/Entry.php';
0028 
0029 /**
0030  * @see Zend_Calendar_Extension_AccessLevel
0031  */
0032 // require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
0033 
0034 /**
0035  * @see Zend_Calendar_Extension_Color
0036  */
0037 // require_once 'Zend/Gdata/Calendar/Extension/Color.php';
0038 
0039 /**
0040  * @see Zend_Calendar_Extension_Hidden
0041  */
0042 // require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
0043 
0044 /**
0045  * @see Zend_Calendar_Extension_Selected
0046  */
0047 // require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
0048 
0049 /**
0050  * @see Zend_Gdata_Extension_EventStatus
0051  */
0052 // require_once 'Zend/Gdata/Extension/EventStatus.php';
0053 
0054 /**
0055  * @see Zend_Gdata_Extension_Visibility
0056  */
0057 // require_once 'Zend/Gdata/Extension/Visibility.php';
0058 
0059 
0060 /**
0061  * @see Zend_Extension_Where
0062  */
0063 // require_once 'Zend/Gdata/Extension/Where.php';
0064 
0065 /**
0066  * Represents a Calendar entry in the Calendar data API meta feed of a user's
0067  * calendars.
0068  *
0069  * @category   Zend
0070  * @package    Zend_Gdata
0071  * @subpackage Calendar
0072  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0073  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0074  */
0075 class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
0076 {
0077 
0078     protected $_color = null;
0079     protected $_accessLevel = null;
0080     protected $_hidden = null;
0081     protected $_selected = null;
0082     protected $_timezone = null;
0083     protected $_where = array();
0084 
0085     public function __construct($element = null)
0086     {
0087         $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
0088         parent::__construct($element);
0089     }
0090 
0091     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
0092     {
0093         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
0094         if ($this->_accessLevel != null) {
0095             $element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
0096         }
0097         if ($this->_color != null) {
0098             $element->appendChild($this->_color->getDOM($element->ownerDocument));
0099         }
0100         if ($this->_hidden != null) {
0101             $element->appendChild($this->_hidden->getDOM($element->ownerDocument));
0102         }
0103         if ($this->_selected != null) {
0104             $element->appendChild($this->_selected->getDOM($element->ownerDocument));
0105         }
0106         if ($this->_timezone != null) {
0107             $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
0108         }
0109         if ($this->_where != null) {
0110             foreach ($this->_where as $where) {
0111                 $element->appendChild($where->getDOM($element->ownerDocument));
0112             }
0113         }
0114         return $element;
0115     }
0116 
0117     protected function takeChildFromDOM($child)
0118     {
0119         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
0120         switch ($absoluteNodeName) {
0121         case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
0122             $accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
0123             $accessLevel->transferFromDOM($child);
0124             $this->_accessLevel = $accessLevel;
0125             break;
0126         case $this->lookupNamespace('gCal') . ':' . 'color';
0127             $color = new Zend_Gdata_Calendar_Extension_Color();
0128             $color->transferFromDOM($child);
0129             $this->_color = $color;
0130             break;
0131         case $this->lookupNamespace('gCal') . ':' . 'hidden';
0132             $hidden = new Zend_Gdata_Calendar_Extension_Hidden();
0133             $hidden->transferFromDOM($child);
0134             $this->_hidden = $hidden;
0135             break;
0136         case $this->lookupNamespace('gCal') . ':' . 'selected';
0137             $selected = new Zend_Gdata_Calendar_Extension_Selected();
0138             $selected->transferFromDOM($child);
0139             $this->_selected = $selected;
0140             break;
0141         case $this->lookupNamespace('gCal') . ':' . 'timezone';
0142             $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
0143             $timezone->transferFromDOM($child);
0144             $this->_timezone = $timezone;
0145             break;
0146         case $this->lookupNamespace('gd') . ':' . 'where';
0147             $where = new Zend_Gdata_Extension_Where();
0148             $where->transferFromDOM($child);
0149             $this->_where[] = $where;
0150             break;
0151         default:
0152             parent::takeChildFromDOM($child);
0153             break;
0154         }
0155     }
0156 
0157     public function getAccessLevel()
0158     {
0159         return $this->_accessLevel;
0160     }
0161 
0162     /**
0163      * @param Zend_Gdata_Calendar_Extension_AccessLevel $value
0164      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
0165      */
0166     public function setAccessLevel($value)
0167     {
0168         $this->_accessLevel = $value;
0169         return $this;
0170     }
0171     public function getColor()
0172     {
0173         return $this->_color;
0174     }
0175 
0176     /**
0177      * @param Zend_Gdata_Calendar_Extension_Color $value
0178      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
0179      */
0180     public function setColor($value)
0181     {
0182         $this->_color = $value;
0183         return $this;
0184     }
0185 
0186     public function getHidden()
0187     {
0188         return $this->_hidden;
0189     }
0190 
0191     /**
0192      * @param Zend_Gdata_Calendar_Extension_Hidden $value
0193      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
0194      */
0195     public function setHidden($value)
0196     {
0197         $this->_hidden = $value;
0198         return $this;
0199     }
0200 
0201     public function getSelected()
0202     {
0203         return $this->_selected;
0204     }
0205 
0206     /**
0207      * @param Zend_Gdata_Calendar_Extension_Selected $value
0208      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
0209      */
0210     public function setSelected($value)
0211     {
0212         $this->_selected = $value;
0213         return $this;
0214     }
0215 
0216     public function getTimezone()
0217     {
0218         return $this->_timezone;
0219     }
0220 
0221     /**
0222      * @param Zend_Gdata_Calendar_Extension_Timezone $value
0223      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
0224      */
0225     public function setTimezone($value)
0226     {
0227         $this->_timezone = $value;
0228         return $this;
0229     }
0230 
0231     public function getWhere()
0232     {
0233         return $this->_where;
0234     }
0235 
0236     /**
0237      * @param Zend_Gdata_Extension_Where $value
0238      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
0239      */
0240     public function setWhere($value)
0241     {
0242         $this->_where = $value;
0243         return $this;
0244     }
0245 
0246 }