2
0

EventEntry.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * @see Zend_Gdata_Entry
  23. */
  24. require_once 'Zend/Gdata/Entry.php';
  25. /**
  26. * @see Zend_Gdata_Kind_EventEntry
  27. */
  28. require_once 'Zend/Gdata/Kind/EventEntry.php';
  29. /**
  30. * @see Zend_Gdata_Calendar_Extension_SendEventNotifications
  31. */
  32. require_once 'Zend/Gdata/Calendar/Extension/SendEventNotifications.php';
  33. /**
  34. * @see Zend_Gdata_Calendar_Extension_Timezone
  35. */
  36. require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
  37. /**
  38. * @see Zend_Gdata_Calendar_Extension_Link
  39. */
  40. require_once 'Zend/Gdata/Calendar/Extension/Link.php';
  41. /**
  42. * @see Zend_Gdata_Calendar_Extension_QuickAdd
  43. */
  44. require_once 'Zend/Gdata/Calendar/Extension/QuickAdd.php';
  45. /**
  46. * Data model class for a Google Calendar Event Entry
  47. *
  48. * @category Zend
  49. * @package Zend_Gdata
  50. * @subpackage Calendar
  51. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  52. * @license http://framework.zend.com/license/new-bsd New BSD License
  53. */
  54. class Zend_Gdata_Calendar_EventEntry extends Zend_Gdata_Kind_EventEntry
  55. {
  56. protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
  57. protected $_sendEventNotifications = null;
  58. protected $_timezone = null;
  59. protected $_quickadd = null;
  60. public function __construct($element = null)
  61. {
  62. $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
  63. parent::__construct($element);
  64. }
  65. public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
  66. {
  67. $element = parent::getDOM($doc, $majorVersion, $minorVersion);
  68. if ($this->_sendEventNotifications != null) {
  69. $element->appendChild($this->_sendEventNotifications->getDOM($element->ownerDocument));
  70. }
  71. if ($this->_timezone != null) {
  72. $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
  73. }
  74. if ($this->_quickadd != null) {
  75. $element->appendChild($this->_quickadd->getDOM($element->ownerDocument));
  76. }
  77. return $element;
  78. }
  79. protected function takeChildFromDOM($child)
  80. {
  81. $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
  82. switch ($absoluteNodeName) {
  83. case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications';
  84. $sendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications();
  85. $sendEventNotifications->transferFromDOM($child);
  86. $this->_sendEventNotifications = $sendEventNotifications;
  87. break;
  88. case $this->lookupNamespace('gCal') . ':' . 'timezone';
  89. $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
  90. $timezone->transferFromDOM($child);
  91. $this->_timezone = $timezone;
  92. break;
  93. case $this->lookupNamespace('atom') . ':' . 'link';
  94. $link = new Zend_Gdata_Calendar_Extension_Link();
  95. $link->transferFromDOM($child);
  96. $this->_link[] = $link;
  97. break;
  98. case $this->lookupNamespace('gCal') . ':' . 'quickadd';
  99. $quickadd = new Zend_Gdata_Calendar_Extension_QuickAdd();
  100. $quickadd->transferFromDOM($child);
  101. $this->_quickadd = $quickadd;
  102. break;
  103. default:
  104. parent::takeChildFromDOM($child);
  105. break;
  106. }
  107. }
  108. public function getSendEventNotifications()
  109. {
  110. return $this->_sendEventNotifications;
  111. }
  112. public function setSendEventNotifications($value)
  113. {
  114. $this->_sendEventNotifications = $value;
  115. return $this;
  116. }
  117. public function getTimezone()
  118. {
  119. return $this->_timezone;
  120. }
  121. /**
  122. * @param Zend_Gdata_Calendar_Extension_Timezone $value
  123. * @return Zend_Gdata_Extension_EventEntry Provides a fluent interface
  124. */
  125. public function setTimezone($value)
  126. {
  127. $this->_timezone = $value;
  128. return $this;
  129. }
  130. public function getQuickAdd()
  131. {
  132. return $this->_quickadd;
  133. }
  134. /**
  135. * @param Zend_Gdata_Calendar_Extension_QuickAdd $value
  136. * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
  137. */
  138. public function setQuickAdd($value)
  139. {
  140. $this->_quickadd = $value;
  141. return $this;
  142. }
  143. }