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.
19 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id: OriginalEvent.php 16971 2009-07-22 18:05:45Z mikaelkael $
25 * @see Zend_Gdata_Extension
27 require_once 'Zend/Gdata/Extension.php';
30 * @see Zend_Gdata_Feed
32 require_once 'Zend/Gdata/Feed.php';
35 * @see Zend_Gdata_When
37 require_once 'Zend/Gdata/Extension/When.php';
40 * Represents the gd:originalEvent element
45 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
46 * @license http://framework.zend.com/license/new-bsd New BSD License
48 class Zend_Gdata_Extension_OriginalEvent
extends Zend_Gdata_Extension
51 protected $_rootElement = 'originalEvent';
52 protected $_id = null;
53 protected $_href = null;
54 protected $_when = null;
56 public function __construct($id = null, $href = null, $when = null)
58 parent
::__construct();
64 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
66 $element = parent
::getDOM($doc, $majorVersion, $minorVersion);
67 if ($this->_id
!== null) {
68 $element->setAttribute('id', $this->_id
);
70 if ($this->_href
!== null) {
71 $element->setAttribute('href', $this->_href
);
73 if ($this->_when
!== null) {
74 $element->appendChild($this->_when
->getDOM($element->ownerDocument
));
79 protected function takeAttributeFromDOM($attribute)
81 switch ($attribute->localName
) {
83 $this->_id
= $attribute->nodeValue
;
86 $this->_href
= $attribute->nodeValue
;
89 parent
::takeAttributeFromDOM($attribute);
93 protected function takeChildFromDOM($child)
95 $absoluteNodeName = $child->namespaceURI
. ':' . $child->localName
;
96 switch ($absoluteNodeName) {
97 case $this->lookupNamespace('gd') . ':' . 'when';
98 $when = new Zend_Gdata_Extension_When();
99 $when->transferFromDOM($child);
100 $this->_when
= $when;
103 parent
::takeChildFromDOM($child);
108 public function getId()
113 public function setId($value)
119 public function getHref()
124 public function setHref($value)
126 $this->_href
= $value;
130 public function getWhen()
135 public function setWhen($value)
137 $this->_when
= $value;