/library/Zend/Gdata/Calendar/EventEntry.php

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