File indexing completed on 2025-02-23 05:32:24

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_Feed
0026  */
0027 // require_once 'Zend/Gdata/Feed.php';
0028 
0029 /**
0030  * @see Zend_Gdata_Extension_Timezone
0031  */
0032 // require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
0033 
0034 /**
0035  * Data model for a Google Calendar feed of events
0036  *
0037  * @category   Zend
0038  * @package    Zend_Gdata
0039  * @subpackage Calendar
0040  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0041  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0042  */
0043 class Zend_Gdata_Calendar_EventFeed extends Zend_Gdata_Feed
0044 {
0045 
0046     protected $_timezone = null;
0047 
0048     /**
0049      * The classname for individual feed elements.
0050      *
0051      * @var string
0052      */
0053     protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
0054 
0055     /**
0056      * The classname for the feed.
0057      *
0058      * @var string
0059      */
0060     protected $_feedClassName = 'Zend_Gdata_Calendar_EventFeed';
0061 
0062     public function __construct($element = null)
0063     {
0064         $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
0065         parent::__construct($element);
0066     }
0067 
0068     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
0069     {
0070         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
0071         if ($this->_timezone != null) {
0072             $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
0073         }
0074 
0075         return $element;
0076     }
0077 
0078     protected function takeChildFromDOM($child)
0079     {
0080         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
0081 
0082         switch ($absoluteNodeName) {
0083             case $this->lookupNamespace('gCal') . ':' . 'timezone';
0084                 $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
0085                 $timezone->transferFromDOM($child);
0086                 $this->_timezone = $timezone;
0087                 break;
0088 
0089             default:
0090                 parent::takeChildFromDOM($child);
0091                 break;
0092         }
0093     }
0094 
0095     public function getTimezone()
0096     {
0097         return $this->_timezone;
0098     }
0099 
0100     public function setTimezone($value)
0101     {
0102         $this->_timezone = $value;
0103         return $this;
0104     }
0105 
0106 }