PageRenderTime 54ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/src/frapi/library/Zend/Gdata/Calendar/ListEntry.php

https://github.com/Martin1982/IBMessagingWorkshopServer
PHP | 246 lines | 133 code | 27 blank | 86 comment | 13 complexity | a8963fb56e2eb5418c76b86e92dcd176 MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Gdata
  17. * @subpackage Calendar
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: ListEntry.php 20096 2010-01-06 02:05:09Z bkarwin $
  21. */
  22. /**
  23. * @see Zend_Gdata_Entry
  24. */
  25. // require_once 'Zend/Gdata/Entry.php';
  26. /**
  27. * @see Zend_Calendar_Extension_AccessLevel
  28. */
  29. // require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
  30. /**
  31. * @see Zend_Calendar_Extension_Color
  32. */
  33. // require_once 'Zend/Gdata/Calendar/Extension/Color.php';
  34. /**
  35. * @see Zend_Calendar_Extension_Hidden
  36. */
  37. // require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
  38. /**
  39. * @see Zend_Calendar_Extension_Selected
  40. */
  41. // require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
  42. /**
  43. * @see Zend_Gdata_Extension_EventStatus
  44. */
  45. // require_once 'Zend/Gdata/Extension/EventStatus.php';
  46. /**
  47. * @see Zend_Gdata_Extension_Visibility
  48. */
  49. // require_once 'Zend/Gdata/Extension/Visibility.php';
  50. /**
  51. * @see Zend_Extension_Where
  52. */
  53. // require_once 'Zend/Gdata/Extension/Where.php';
  54. /**
  55. * Represents a Calendar entry in the Calendar data API meta feed of a user's
  56. * calendars.
  57. *
  58. * @category Zend
  59. * @package Zend_Gdata
  60. * @subpackage Calendar
  61. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  62. * @license http://framework.zend.com/license/new-bsd New BSD License
  63. */
  64. class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
  65. {
  66. protected $_color = null;
  67. protected $_accessLevel = null;
  68. protected $_hidden = null;
  69. protected $_selected = null;
  70. protected $_timezone = null;
  71. protected $_where = array();
  72. public function __construct($element = null)
  73. {
  74. $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
  75. parent::__construct($element);
  76. }
  77. public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
  78. {
  79. $element = parent::getDOM($doc, $majorVersion, $minorVersion);
  80. if ($this->_accessLevel != null) {
  81. $element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
  82. }
  83. if ($this->_color != null) {
  84. $element->appendChild($this->_color->getDOM($element->ownerDocument));
  85. }
  86. if ($this->_hidden != null) {
  87. $element->appendChild($this->_hidden->getDOM($element->ownerDocument));
  88. }
  89. if ($this->_selected != null) {
  90. $element->appendChild($this->_selected->getDOM($element->ownerDocument));
  91. }
  92. if ($this->_timezone != null) {
  93. $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
  94. }
  95. if ($this->_where != null) {
  96. foreach ($this->_where as $where) {
  97. $element->appendChild($where->getDOM($element->ownerDocument));
  98. }
  99. }
  100. return $element;
  101. }
  102. protected function takeChildFromDOM($child)
  103. {
  104. $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
  105. switch ($absoluteNodeName) {
  106. case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
  107. $accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
  108. $accessLevel->transferFromDOM($child);
  109. $this->_accessLevel = $accessLevel;
  110. break;
  111. case $this->lookupNamespace('gCal') . ':' . 'color';
  112. $color = new Zend_Gdata_Calendar_Extension_Color();
  113. $color->transferFromDOM($child);
  114. $this->_color = $color;
  115. break;
  116. case $this->lookupNamespace('gCal') . ':' . 'hidden';
  117. $hidden = new Zend_Gdata_Calendar_Extension_Hidden();
  118. $hidden->transferFromDOM($child);
  119. $this->_hidden = $hidden;
  120. break;
  121. case $this->lookupNamespace('gCal') . ':' . 'selected';
  122. $selected = new Zend_Gdata_Calendar_Extension_Selected();
  123. $selected->transferFromDOM($child);
  124. $this->_selected = $selected;
  125. break;
  126. case $this->lookupNamespace('gCal') . ':' . 'timezone';
  127. $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
  128. $timezone->transferFromDOM($child);
  129. $this->_timezone = $timezone;
  130. break;
  131. case $this->lookupNamespace('gd') . ':' . 'where';
  132. $where = new Zend_Gdata_Extension_Where();
  133. $where->transferFromDOM($child);
  134. $this->_where[] = $where;
  135. break;
  136. default:
  137. parent::takeChildFromDOM($child);
  138. break;
  139. }
  140. }
  141. public function getAccessLevel()
  142. {
  143. return $this->_accessLevel;
  144. }
  145. /**
  146. * @param Zend_Gdata_Calendar_Extension_AccessLevel $value
  147. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  148. */
  149. public function setAccessLevel($value)
  150. {
  151. $this->_accessLevel = $value;
  152. return $this;
  153. }
  154. public function getColor()
  155. {
  156. return $this->_color;
  157. }
  158. /**
  159. * @param Zend_Gdata_Calendar_Extension_Color $value
  160. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  161. */
  162. public function setColor($value)
  163. {
  164. $this->_color = $value;
  165. return $this;
  166. }
  167. public function getHidden()
  168. {
  169. return $this->_hidden;
  170. }
  171. /**
  172. * @param Zend_Gdata_Calendar_Extension_Hidden $value
  173. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  174. */
  175. public function setHidden($value)
  176. {
  177. $this->_hidden = $value;
  178. return $this;
  179. }
  180. public function getSelected()
  181. {
  182. return $this->_selected;
  183. }
  184. /**
  185. * @param Zend_Gdata_Calendar_Extension_Selected $value
  186. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  187. */
  188. public function setSelected($value)
  189. {
  190. $this->_selected = $value;
  191. return $this;
  192. }
  193. public function getTimezone()
  194. {
  195. return $this->_timezone;
  196. }
  197. /**
  198. * @param Zend_Gdata_Calendar_Extension_Timezone $value
  199. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  200. */
  201. public function setTimezone($value)
  202. {
  203. $this->_timezone = $value;
  204. return $this;
  205. }
  206. public function getWhere()
  207. {
  208. return $this->_where;
  209. }
  210. /**
  211. * @param Zend_Gdata_Extension_Where $value
  212. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  213. */
  214. public function setWhere($value)
  215. {
  216. $this->_where = $value;
  217. return $this;
  218. }
  219. }