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.
18 * @subpackage Calendar
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_Entry
27 require_once 'Zend/Gdata/Entry.php';
30 * @see Zend_Calendar_Extension_AccessLevel
32 require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
35 * @see Zend_Calendar_Extension_Color
37 require_once 'Zend/Gdata/Calendar/Extension/Color.php';
40 * @see Zend_Calendar_Extension_Hidden
42 require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
45 * @see Zend_Calendar_Extension_Selected
47 require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
50 * @see Zend_Gdata_Extension_EventStatus
52 require_once 'Zend/Gdata/Extension/EventStatus.php';
55 * @see Zend_Gdata_Extension_Visibility
57 require_once 'Zend/Gdata/Extension/Visibility.php';
61 * @see Zend_Extension_Where
63 require_once 'Zend/Gdata/Extension/Where.php';
66 * Represents a Calendar entry in the Calendar data API meta feed of a user's
71 * @subpackage Calendar
72 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
73 * @license http://framework.zend.com/license/new-bsd New BSD License
75 class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
78 protected $_color = null;
79 protected $_accessLevel = null;
80 protected $_hidden = null;
81 protected $_selected = null;
82 protected $_timezone = null;
83 protected $_where = array();
85 public function __construct($element = null)
87 $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
88 parent::__construct($element);
91 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
93 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
94 if ($this->_accessLevel != null) {
95 $element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
97 if ($this->_color != null) {
98 $element->appendChild($this->_color->getDOM($element->ownerDocument));
100 if ($this->_hidden != null) {
101 $element->appendChild($this->_hidden->getDOM($element->ownerDocument));
103 if ($this->_selected != null) {
104 $element->appendChild($this->_selected->getDOM($element->ownerDocument));
106 if ($this->_timezone != null) {
107 $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
109 if ($this->_where != null) {
110 foreach ($this->_where as $where) {
111 $element->appendChild($where->getDOM($element->ownerDocument));
117 protected function takeChildFromDOM($child)
119 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
120 switch ($absoluteNodeName) {
121 case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
122 $accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
123 $accessLevel->transferFromDOM($child);
124 $this->_accessLevel = $accessLevel;
126 case $this->lookupNamespace('gCal') . ':' . 'color';
127 $color = new Zend_Gdata_Calendar_Extension_Color();
128 $color->transferFromDOM($child);
129 $this->_color = $color;
131 case $this->lookupNamespace('gCal') . ':' . 'hidden';
132 $hidden = new Zend_Gdata_Calendar_Extension_Hidden();
133 $hidden->transferFromDOM($child);
134 $this->_hidden = $hidden;
136 case $this->lookupNamespace('gCal') . ':' . 'selected';
137 $selected = new Zend_Gdata_Calendar_Extension_Selected();
138 $selected->transferFromDOM($child);
139 $this->_selected = $selected;
141 case $this->lookupNamespace('gCal') . ':' . 'timezone';
142 $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
143 $timezone->transferFromDOM($child);
144 $this->_timezone = $timezone;
146 case $this->lookupNamespace('gd') . ':' . 'where';
147 $where = new Zend_Gdata_Extension_Where();
148 $where->transferFromDOM($child);
149 $this->_where[] = $where;
152 parent::takeChildFromDOM($child);
157 public function getAccessLevel()
159 return $this->_accessLevel;
163 * @param Zend_Gdata_Calendar_Extension_AccessLevel $value
164 * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
166 public function setAccessLevel($value)
168 $this->_accessLevel = $value;
171 public function getColor()
173 return $this->_color;
177 * @param Zend_Gdata_Calendar_Extension_Color $value
178 * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
180 public function setColor($value)
182 $this->_color = $value;
186 public function getHidden()
188 return $this->_hidden;
192 * @param Zend_Gdata_Calendar_Extension_Hidden $value
193 * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
195 public function setHidden($value)
197 $this->_hidden = $value;
201 public function getSelected()
203 return $this->_selected;
207 * @param Zend_Gdata_Calendar_Extension_Selected $value
208 * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
210 public function setSelected($value)
212 $this->_selected = $value;
216 public function getTimezone()
218 return $this->_timezone;
222 * @param Zend_Gdata_Calendar_Extension_Timezone $value
223 * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
225 public function setTimezone($value)
227 $this->_timezone = $value;
231 public function getWhere()
233 return $this->_where;
237 * @param Zend_Gdata_Extension_Where $value
238 * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
240 public function setWhere($value)
242 $this->_where = $value;