*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Gdata / Kind / EventEntry.php
blob8965120d67f38847d05c6fb27a49280edc6c80af
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
16 * @package Zend_Gdata
17 * @subpackage Gdata
18 * @copyright Copyright (c) 2005-2009 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 16971 2009-07-22 18:05:45Z mikaelkael $
23 /**
24 * @see Zend_Gdata_Entry
26 require_once 'Zend/Gdata/Entry.php';
28 /**
29 * @see Zend_Gdata_App_Extension
31 require_once 'Zend/Gdata/App/Extension.php';
33 /**
34 * @see Zend_Gdata_Extension_Where
36 require_once 'Zend/Gdata/Extension/Where.php';
38 /**
39 * @see Zend_Gdata_Extension_When
41 require_once 'Zend/Gdata/Extension/When.php';
43 /**
44 * @see Zend_Gdata_Extension_Who
46 require_once 'Zend/Gdata/Extension/Who.php';
48 /**
49 * @see Zend_Gdata_Extension_Recurrence
51 require_once 'Zend/Gdata/Extension/Recurrence.php';
53 /**
54 * @see Zend_Gdata_Extension_EventStatus
56 require_once 'Zend/Gdata/Extension/EventStatus.php';
58 /**
59 * @see Zend_Gdata_Extension_Comments
61 require_once 'Zend/Gdata/Extension/Comments.php';
63 /**
64 * @see Zend_Gdata_Extension_Transparency
66 require_once 'Zend/Gdata/Extension/Transparency.php';
68 /**
69 * @see Zend_Gdata_Extension_Visibility
71 require_once 'Zend/Gdata/Extension/Visibility.php';
73 /**
74 * @see Zend_Gdata_Extension_ExtendedProperty
76 require_once 'Zend/Gdata/Extension/ExtendedProperty.php';
78 /**
79 * @see Zend_Gdata_Extension_OriginalEvent
81 require_once 'Zend/Gdata/Extension/OriginalEvent.php';
83 /**
84 * @see Zend_Gdata_Extension_EntryLink
86 require_once 'Zend/Gdata/Extension/EntryLink.php';
88 /**
89 * Data model for the Gdata Event "Kind". Google Calendar has a separate
90 * EventEntry class which extends this.
92 * @category Zend
93 * @package Zend_Gdata
94 * @subpackage Gdata
95 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
96 * @license http://framework.zend.com/license/new-bsd New BSD License
98 class Zend_Gdata_Kind_EventEntry extends Zend_Gdata_Entry
100 protected $_who = array();
101 protected $_when = array();
102 protected $_where = array();
103 protected $_recurrence = null;
104 protected $_eventStatus = null;
105 protected $_comments = null;
106 protected $_transparency = null;
107 protected $_visibility = null;
108 protected $_recurrenceException = array();
109 protected $_extendedProperty = array();
110 protected $_originalEvent = null;
111 protected $_entryLink = null;
113 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
115 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
116 if ($this->_who != null) {
117 foreach ($this->_who as $who) {
118 $element->appendChild($who->getDOM($element->ownerDocument));
121 if ($this->_when != null) {
122 foreach ($this->_when as $when) {
123 $element->appendChild($when->getDOM($element->ownerDocument));
126 if ($this->_where != null) {
127 foreach ($this->_where as $where) {
128 $element->appendChild($where->getDOM($element->ownerDocument));
131 if ($this->_recurrenceException != null) {
132 foreach ($this->_recurrenceException as $recurrenceException) {
133 $element->appendChild($recurrenceException->getDOM($element->ownerDocument));
136 if ($this->_extendedProperty != null) {
137 foreach ($this->_extendedProperty as $extProp) {
138 $element->appendChild($extProp->getDOM($element->ownerDocument));
142 if ($this->_recurrence != null) {
143 $element->appendChild($this->_recurrence->getDOM($element->ownerDocument));
145 if ($this->_eventStatus != null) {
146 $element->appendChild($this->_eventStatus->getDOM($element->ownerDocument));
148 if ($this->_comments != null) {
149 $element->appendChild($this->_comments->getDOM($element->ownerDocument));
151 if ($this->_transparency != null) {
152 $element->appendChild($this->_transparency->getDOM($element->ownerDocument));
154 if ($this->_visibility != null) {
155 $element->appendChild($this->_visibility->getDOM($element->ownerDocument));
157 if ($this->_originalEvent != null) {
158 $element->appendChild($this->_originalEvent->getDOM($element->ownerDocument));
160 if ($this->_entryLink != null) {
161 $element->appendChild($this->_entryLink->getDOM($element->ownerDocument));
165 return $element;
168 protected function takeChildFromDOM($child)
170 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
171 switch ($absoluteNodeName) {
172 case $this->lookupNamespace('gd') . ':' . 'where';
173 $where = new Zend_Gdata_Extension_Where();
174 $where->transferFromDOM($child);
175 $this->_where[] = $where;
176 break;
177 case $this->lookupNamespace('gd') . ':' . 'when';
178 $when = new Zend_Gdata_Extension_When();
179 $when->transferFromDOM($child);
180 $this->_when[] = $when;
181 break;
182 case $this->lookupNamespace('gd') . ':' . 'who';
183 $who = new Zend_Gdata_Extension_Who();
184 $who ->transferFromDOM($child);
185 $this->_who[] = $who;
186 break;
187 case $this->lookupNamespace('gd') . ':' . 'recurrence';
188 $recurrence = new Zend_Gdata_Extension_Recurrence();
189 $recurrence->transferFromDOM($child);
190 $this->_recurrence = $recurrence;
191 break;
192 case $this->lookupNamespace('gd') . ':' . 'eventStatus';
193 $eventStatus = new Zend_Gdata_Extension_EventStatus();
194 $eventStatus->transferFromDOM($child);
195 $this->_eventStatus = $eventStatus;
196 break;
197 case $this->lookupNamespace('gd') . ':' . 'comments';
198 $comments = new Zend_Gdata_Extension_Comments();
199 $comments->transferFromDOM($child);
200 $this->_comments = $comments;
201 break;
202 case $this->lookupNamespace('gd') . ':' . 'transparency';
203 $transparency = new Zend_Gdata_Extension_Transparency();
204 $transparency ->transferFromDOM($child);
205 $this->_transparency = $transparency;
206 break;
207 case $this->lookupNamespace('gd') . ':' . 'visibility';
208 $visiblity = new Zend_Gdata_Extension_Visibility();
209 $visiblity ->transferFromDOM($child);
210 $this->_visibility = $visiblity;
211 break;
212 case $this->lookupNamespace('gd') . ':' . 'recurrenceException';
213 require_once 'Zend/Gdata/Extension/RecurrenceException.php';
214 $recurrenceException = new Zend_Gdata_Extension_RecurrenceException();
215 $recurrenceException ->transferFromDOM($child);
216 $this->_recurrenceException[] = $recurrenceException;
217 break;
218 case $this->lookupNamespace('gd') . ':' . 'originalEvent';
219 $originalEvent = new Zend_Gdata_Extension_OriginalEvent();
220 $originalEvent ->transferFromDOM($child);
221 $this->_originalEvent = $originalEvent;
222 break;
223 case $this->lookupNamespace('gd') . ':' . 'extendedProperty';
224 $extProp = new Zend_Gdata_Extension_ExtendedProperty();
225 $extProp->transferFromDOM($child);
226 $this->_extendedProperty[] = $extProp;
227 break;
228 case $this->lookupNamespace('gd') . ':' . 'entryLink':
229 $entryLink = new Zend_Gdata_Extension_EntryLink();
230 $entryLink->transferFromDOM($child);
231 $this->_entryLink = $entryLink;
232 break;
234 default:
235 parent::takeChildFromDOM($child);
236 break;
240 public function getWhen()
242 return $this->_when;
246 * @param array $value
247 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
249 public function setWhen($value)
251 $this->_when = $value;
252 return $this;
255 public function getWhere()
257 return $this->_where;
261 * @param array $value
262 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
264 public function setWhere($value)
266 $this->_where = $value;
267 return $this;
270 public function getWho()
272 return $this->_who;
276 * @param array $value
277 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
279 public function setWho($value)
281 $this->_who = $value;
282 return $this;
285 public function getRecurrence()
287 return $this->_recurrence;
291 * @param array $value
292 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
294 public function setRecurrence($value)
296 $this->_recurrence = $value;
297 return $this;
300 public function getEventStatus()
302 return $this->_eventStatus;
306 * @param array $value
307 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
309 public function setEventStatus($value)
311 $this->_eventStatus = $value;
312 return $this;
315 public function getComments()
317 return $this->_comments;
321 * @param array $value
322 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
324 public function setComments($value)
326 $this->_comments = $value;
327 return $this;
330 public function getTransparency()
332 return $this->_transparency;
336 * @param Zend_Gdata_Transparency $value
337 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
339 public function setTransparency($value)
341 $this->_transparency = $value;
342 return $this;
345 public function getVisibility()
347 return $this->_visibility;
351 * @param Zend_Gdata_Visibility $value
352 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
354 public function setVisibility($value)
356 $this->_visibility = $value;
357 return $this;
360 public function getRecurrenceExcption()
362 return $this->_recurrenceException;
366 * @param array $value
367 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
369 public function setRecurrenceException($value)
371 $this->_recurrenceException = $value;
372 return $this;
375 public function getExtendedProperty()
377 return $this->_extendedProperty;
381 * @param array $value
382 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
384 public function setExtendedProperty($value)
386 $this->_extendedProperty = $value;
387 return $this;
390 public function getOriginalEvent()
392 return $this->_originalEvent;
396 * @param Zend_Gdata_Extension_OriginalEvent $value
397 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
399 public function setOriginalEvent($value)
401 $this->_originalEvent = $value;
402 return $this;
406 * Get this entry's EntryLink element.
408 * @return Zend_Gdata_Extension_EntryLink The requested entry.
410 public function getEntryLink()
412 return $this->_entryLink;
416 * Set the child's EntryLink element.
418 * @param Zend_Gdata_Extension_EntryLink $value The desired value for this attribute.
419 * @return Zend_Gdata_Extension_Who The element being modified.
421 public function setEntryLink($value)
423 $this->_entryLink = $value;
424 return $this;