[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_Entry
|
---|
| 25 | */
|
---|
| 26 | require_once 'Zend/Gdata/Entry.php';
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * @see Zend_Calendar_Extension_AccessLevel
|
---|
| 30 | */
|
---|
| 31 | require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
|
---|
| 32 |
|
---|
| 33 | /**
|
---|
| 34 | * @see Zend_Calendar_Extension_Color
|
---|
| 35 | */
|
---|
| 36 | require_once 'Zend/Gdata/Calendar/Extension/Color.php';
|
---|
| 37 |
|
---|
| 38 | /**
|
---|
| 39 | * @see Zend_Calendar_Extension_Hidden
|
---|
| 40 | */
|
---|
| 41 | require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
|
---|
| 42 |
|
---|
| 43 | /**
|
---|
| 44 | * @see Zend_Calendar_Extension_Selected
|
---|
| 45 | */
|
---|
| 46 | require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
|
---|
| 47 |
|
---|
| 48 | /**
|
---|
| 49 | * @see Zend_Gdata_Extension_EventStatus
|
---|
| 50 | */
|
---|
| 51 | require_once 'Zend/Gdata/Extension/EventStatus.php';
|
---|
| 52 |
|
---|
| 53 | /**
|
---|
| 54 | * @see Zend_Gdata_Extension_Visibility
|
---|
| 55 | */
|
---|
| 56 | require_once 'Zend/Gdata/Extension/Visibility.php';
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | /**
|
---|
| 60 | * @see Zend_Extension_Where
|
---|
| 61 | */
|
---|
| 62 | require_once 'Zend/Gdata/Extension/Where.php';
|
---|
| 63 |
|
---|
| 64 | /**
|
---|
| 65 | * Represents a Calendar entry in the Calendar data API meta feed of a user's
|
---|
| 66 | * calendars.
|
---|
| 67 | *
|
---|
| 68 | * @category Zend
|
---|
| 69 | * @package Zend_Gdata
|
---|
| 70 | * @subpackage Calendar
|
---|
| 71 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
| 72 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
| 73 | */
|
---|
| 74 | class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
|
---|
| 75 | {
|
---|
| 76 |
|
---|
| 77 | protected $_color = null;
|
---|
| 78 | protected $_accessLevel = null;
|
---|
| 79 | protected $_hidden = null;
|
---|
| 80 | protected $_selected = null;
|
---|
| 81 | protected $_timezone = null;
|
---|
| 82 | protected $_where = array();
|
---|
| 83 |
|
---|
| 84 | public function __construct($element = null)
|
---|
| 85 | {
|
---|
| 86 | $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
|
---|
| 87 | parent::__construct($element);
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
| 91 | {
|
---|
| 92 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
| 93 | if ($this->_accessLevel != null) {
|
---|
| 94 | $element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
|
---|
| 95 | }
|
---|
| 96 | if ($this->_color != null) {
|
---|
| 97 | $element->appendChild($this->_color->getDOM($element->ownerDocument));
|
---|
| 98 | }
|
---|
| 99 | if ($this->_hidden != null) {
|
---|
| 100 | $element->appendChild($this->_hidden->getDOM($element->ownerDocument));
|
---|
| 101 | }
|
---|
| 102 | if ($this->_selected != null) {
|
---|
| 103 | $element->appendChild($this->_selected->getDOM($element->ownerDocument));
|
---|
| 104 | }
|
---|
| 105 | if ($this->_timezone != null) {
|
---|
| 106 | $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
|
---|
| 107 | }
|
---|
| 108 | if ($this->_where != null) {
|
---|
| 109 | foreach ($this->_where as $where) {
|
---|
| 110 | $element->appendChild($where->getDOM($element->ownerDocument));
|
---|
| 111 | }
|
---|
| 112 | }
|
---|
| 113 | return $element;
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | protected function takeChildFromDOM($child)
|
---|
| 117 | {
|
---|
| 118 | $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
---|
| 119 | switch ($absoluteNodeName) {
|
---|
| 120 | case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
|
---|
| 121 | $accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
|
---|
| 122 | $accessLevel->transferFromDOM($child);
|
---|
| 123 | $this->_accessLevel = $accessLevel;
|
---|
| 124 | break;
|
---|
| 125 | case $this->lookupNamespace('gCal') . ':' . 'color';
|
---|
| 126 | $color = new Zend_Gdata_Calendar_Extension_Color();
|
---|
| 127 | $color->transferFromDOM($child);
|
---|
| 128 | $this->_color = $color;
|
---|
| 129 | break;
|
---|
| 130 | case $this->lookupNamespace('gCal') . ':' . 'hidden';
|
---|
| 131 | $hidden = new Zend_Gdata_Calendar_Extension_Hidden();
|
---|
| 132 | $hidden->transferFromDOM($child);
|
---|
| 133 | $this->_hidden = $hidden;
|
---|
| 134 | break;
|
---|
| 135 | case $this->lookupNamespace('gCal') . ':' . 'selected';
|
---|
| 136 | $selected = new Zend_Gdata_Calendar_Extension_Selected();
|
---|
| 137 | $selected->transferFromDOM($child);
|
---|
| 138 | $this->_selected = $selected;
|
---|
| 139 | break;
|
---|
| 140 | case $this->lookupNamespace('gCal') . ':' . 'timezone';
|
---|
| 141 | $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
|
---|
| 142 | $timezone->transferFromDOM($child);
|
---|
| 143 | $this->_timezone = $timezone;
|
---|
| 144 | break;
|
---|
| 145 | case $this->lookupNamespace('gd') . ':' . 'where';
|
---|
| 146 | $where = new Zend_Gdata_Extension_Where();
|
---|
| 147 | $where->transferFromDOM($child);
|
---|
| 148 | $this->_where[] = $where;
|
---|
| 149 | break;
|
---|
| 150 | default:
|
---|
| 151 | parent::takeChildFromDOM($child);
|
---|
| 152 | break;
|
---|
| 153 | }
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | public function getAccessLevel()
|
---|
| 157 | {
|
---|
| 158 | return $this->_accessLevel;
|
---|
| 159 | }
|
---|
| 160 |
|
---|
| 161 | /**
|
---|
| 162 | * @param Zend_Gdata_Calendar_Extension_AccessLevel $value
|
---|
| 163 | * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
---|
| 164 | */
|
---|
| 165 | public function setAccessLevel($value)
|
---|
| 166 | {
|
---|
| 167 | $this->_accessLevel = $value;
|
---|
| 168 | return $this;
|
---|
| 169 | }
|
---|
| 170 | public function getColor()
|
---|
| 171 | {
|
---|
| 172 | return $this->_color;
|
---|
| 173 | }
|
---|
| 174 |
|
---|
| 175 | /**
|
---|
| 176 | * @param Zend_Gdata_Calendar_Extension_Color $value
|
---|
| 177 | * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
---|
| 178 | */
|
---|
| 179 | public function setColor($value)
|
---|
| 180 | {
|
---|
| 181 | $this->_color = $value;
|
---|
| 182 | return $this;
|
---|
| 183 | }
|
---|
| 184 |
|
---|
| 185 | public function getHidden()
|
---|
| 186 | {
|
---|
| 187 | return $this->_hidden;
|
---|
| 188 | }
|
---|
| 189 |
|
---|
| 190 | /**
|
---|
| 191 | * @param Zend_Gdata_Calendar_Extension_Hidden $value
|
---|
| 192 | * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
---|
| 193 | */
|
---|
| 194 | public function setHidden($value)
|
---|
| 195 | {
|
---|
| 196 | $this->_hidden = $value;
|
---|
| 197 | return $this;
|
---|
| 198 | }
|
---|
| 199 |
|
---|
| 200 | public function getSelected()
|
---|
| 201 | {
|
---|
| 202 | return $this->_selected;
|
---|
| 203 | }
|
---|
| 204 |
|
---|
| 205 | /**
|
---|
| 206 | * @param Zend_Gdata_Calendar_Extension_Selected $value
|
---|
| 207 | * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
---|
| 208 | */
|
---|
| 209 | public function setSelected($value)
|
---|
| 210 | {
|
---|
| 211 | $this->_selected = $value;
|
---|
| 212 | return $this;
|
---|
| 213 | }
|
---|
| 214 |
|
---|
| 215 | public function getTimezone()
|
---|
| 216 | {
|
---|
| 217 | return $this->_timezone;
|
---|
| 218 | }
|
---|
| 219 |
|
---|
| 220 | /**
|
---|
| 221 | * @param Zend_Gdata_Calendar_Extension_Timezone $value
|
---|
| 222 | * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
---|
| 223 | */
|
---|
| 224 | public function setTimezone($value)
|
---|
| 225 | {
|
---|
| 226 | $this->_timezone = $value;
|
---|
| 227 | return $this;
|
---|
| 228 | }
|
---|
| 229 |
|
---|
| 230 | public function getWhere()
|
---|
| 231 | {
|
---|
| 232 | return $this->_where;
|
---|
| 233 | }
|
---|
| 234 |
|
---|
| 235 | /**
|
---|
| 236 | * @param Zend_Gdata_Extension_Where $value
|
---|
| 237 | * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
|
---|
| 238 | */
|
---|
| 239 | public function setWhere($value)
|
---|
| 240 | {
|
---|
| 241 | $this->_where = $value;
|
---|
| 242 | return $this;
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | }
|
---|