Merge file:///media/external_data/workspace/web/sport-group
[sport-group.git] / library / Zend / Gdata / Extension / OriginalEvent.php
blobae41f3c0dd4ec2b6f7caf2ae9e95a3e5e5ef49b4
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
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.
16 * @category Zend
17 * @package Zend_Gdata
18 * @subpackage Gdata
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 $
24 /**
25 * @see Zend_Gdata_Extension
27 require_once 'Zend/Gdata/Extension.php';
29 /**
30 * @see Zend_Gdata_Feed
32 require_once 'Zend/Gdata/Feed.php';
34 /**
35 * @see Zend_Gdata_When
37 require_once 'Zend/Gdata/Extension/When.php';
39 /**
40 * Represents the gd:originalEvent element
42 * @category Zend
43 * @package Zend_Gdata
44 * @subpackage Gdata
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();
59 $this->_id = $id;
60 $this->_href = $href;
61 $this->_when = $when;
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));
76 return $element;
79 protected function takeAttributeFromDOM($attribute)
81 switch ($attribute->localName) {
82 case 'id':
83 $this->_id = $attribute->nodeValue;
84 break;
85 case 'href':
86 $this->_href = $attribute->nodeValue;
87 break;
88 default:
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;
101 break;
102 default:
103 parent::takeChildFromDOM($child);
104 break;
108 public function getId()
110 return $this->_id;
113 public function setId($value)
115 $this->_id = $value;
116 return $this;
119 public function getHref()
121 return $this->_href;
124 public function setHref($value)
126 $this->_href = $value;
127 return $this;
130 public function getWhen()
132 return $this->_when;
135 public function setWhen($value)
137 $this->_when = $value;
138 return $this;