[44] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Zend Framework
|
---|
| 5 | *
|
---|
| 6 | * LICENSE
|
---|
| 7 | *
|
---|
| 8 | * This source file is subject to the new BSD license that is bundled
|
---|
| 9 | * with this package in the file LICENSE.txt.
|
---|
| 10 | * It is also available through the world-wide-web at this URL:
|
---|
| 11 | * http://framework.zend.com/license/new-bsd
|
---|
| 12 | * If you did not receive a copy of the license and are unable to
|
---|
| 13 | * obtain it through the world-wide-web, please send an email
|
---|
| 14 | * to license@zend.com so we can send you a copy immediately.
|
---|
| 15 | *
|
---|
| 16 | * @category Zend
|
---|
| 17 | * @package Zend_Gdata
|
---|
| 18 | * @subpackage Calendar
|
---|
| 19 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
| 20 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
| 21 | */
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * @see Zend_Gdata_Feed
|
---|
| 25 | */
|
---|
| 26 | require_once 'Zend/Gdata/Feed.php';
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * @see Zend_Gdata_Extension_Timezone
|
---|
| 30 | */
|
---|
| 31 | require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
|
---|
| 32 |
|
---|
| 33 | /**
|
---|
| 34 | * Data model for a Google Calendar feed of events
|
---|
| 35 | *
|
---|
| 36 | * @category Zend
|
---|
| 37 | * @package Zend_Gdata
|
---|
| 38 | * @subpackage Calendar
|
---|
| 39 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
| 40 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
| 41 | */
|
---|
| 42 | class Zend_Gdata_Calendar_EventFeed extends Zend_Gdata_Feed
|
---|
| 43 | {
|
---|
| 44 |
|
---|
| 45 | protected $_timezone = null;
|
---|
| 46 |
|
---|
| 47 | /**
|
---|
| 48 | * The classname for individual feed elements.
|
---|
| 49 | *
|
---|
| 50 | * @var string
|
---|
| 51 | */
|
---|
| 52 | protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
|
---|
| 53 |
|
---|
| 54 | /**
|
---|
| 55 | * The classname for the feed.
|
---|
| 56 | *
|
---|
| 57 | * @var string
|
---|
| 58 | */
|
---|
| 59 | protected $_feedClassName = 'Zend_Gdata_Calendar_EventFeed';
|
---|
| 60 |
|
---|
| 61 | public function __construct($element = null)
|
---|
| 62 | {
|
---|
| 63 | $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
---|
| 64 | parent::__construct($element);
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
| 68 | {
|
---|
| 69 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
| 70 | if ($this->_timezone != null) {
|
---|
| 71 | $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | return $element;
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | protected function takeChildFromDOM($child)
|
---|
| 78 | {
|
---|
| 79 | $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
---|
| 80 |
|
---|
| 81 | switch ($absoluteNodeName) {
|
---|
| 82 | case $this->lookupNamespace('gCal') . ':' . 'timezone';
|
---|
| 83 | $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
|
---|
| 84 | $timezone->transferFromDOM($child);
|
---|
| 85 | $this->_timezone = $timezone;
|
---|
| 86 | break;
|
---|
| 87 |
|
---|
| 88 | default:
|
---|
| 89 | parent::takeChildFromDOM($child);
|
---|
| 90 | break;
|
---|
| 91 | }
|
---|
| 92 | }
|
---|
| 93 |
|
---|
| 94 | public function getTimezone()
|
---|
| 95 | {
|
---|
| 96 | return $this->_timezone;
|
---|
| 97 | }
|
---|
| 98 |
|
---|
| 99 | public function setTimezone($value)
|
---|
| 100 | {
|
---|
| 101 | $this->_timezone = $value;
|
---|
| 102 | return $this;
|
---|
| 103 | }
|
---|
| 104 |
|
---|
| 105 | }
|
---|