File indexing completed on 2025-03-02 05:29:27
0001 <?php 0002 0003 /** 0004 * Zend Framework 0005 * 0006 * LICENSE 0007 * 0008 * This source file is subject to the new BSD license that is bundled 0009 * with this package in the file LICENSE.txt. 0010 * It is also available through the world-wide-web at this URL: 0011 * http://framework.zend.com/license/new-bsd 0012 * If you did not receive a copy of the license and are unable to 0013 * obtain it through the world-wide-web, please send an email 0014 * to license@zend.com so we can send you a copy immediately. 0015 * 0016 * @category Zend 0017 * @package Zend_Gdata 0018 * @subpackage Gdata 0019 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0020 * @license http://framework.zend.com/license/new-bsd New BSD License 0021 * @version $Id$ 0022 */ 0023 0024 /** 0025 * @see Zend_Gdata_Extension 0026 */ 0027 // require_once 'Zend/Gdata/Extension.php'; 0028 0029 /** 0030 * @see Zend_Gdata_Feed 0031 */ 0032 // require_once 'Zend/Gdata/Feed.php'; 0033 0034 /** 0035 * @see Zend_Gdata_When 0036 */ 0037 // require_once 'Zend/Gdata/Extension/When.php'; 0038 0039 /** 0040 * Represents the gd:originalEvent element 0041 * 0042 * @category Zend 0043 * @package Zend_Gdata 0044 * @subpackage Gdata 0045 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0046 * @license http://framework.zend.com/license/new-bsd New BSD License 0047 */ 0048 class Zend_Gdata_Extension_OriginalEvent extends Zend_Gdata_Extension 0049 { 0050 0051 protected $_rootElement = 'originalEvent'; 0052 protected $_id = null; 0053 protected $_href = null; 0054 protected $_when = null; 0055 0056 public function __construct($id = null, $href = null, $when = null) 0057 { 0058 parent::__construct(); 0059 $this->_id = $id; 0060 $this->_href = $href; 0061 $this->_when = $when; 0062 } 0063 0064 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 0065 { 0066 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 0067 if ($this->_id !== null) { 0068 $element->setAttribute('id', $this->_id); 0069 } 0070 if ($this->_href !== null) { 0071 $element->setAttribute('href', $this->_href); 0072 } 0073 if ($this->_when !== null) { 0074 $element->appendChild($this->_when->getDOM($element->ownerDocument)); 0075 } 0076 return $element; 0077 } 0078 0079 protected function takeAttributeFromDOM($attribute) 0080 { 0081 switch ($attribute->localName) { 0082 case 'id': 0083 $this->_id = $attribute->nodeValue; 0084 break; 0085 case 'href': 0086 $this->_href = $attribute->nodeValue; 0087 break; 0088 default: 0089 parent::takeAttributeFromDOM($attribute); 0090 } 0091 } 0092 0093 protected function takeChildFromDOM($child) 0094 { 0095 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 0096 switch ($absoluteNodeName) { 0097 case $this->lookupNamespace('gd') . ':' . 'when'; 0098 $when = new Zend_Gdata_Extension_When(); 0099 $when->transferFromDOM($child); 0100 $this->_when = $when; 0101 break; 0102 default: 0103 parent::takeChildFromDOM($child); 0104 break; 0105 } 0106 } 0107 0108 public function getId() 0109 { 0110 return $this->_id; 0111 } 0112 0113 public function setId($value) 0114 { 0115 $this->_id = $value; 0116 return $this; 0117 } 0118 0119 public function getHref() 0120 { 0121 return $this->_href; 0122 } 0123 0124 public function setHref($value) 0125 { 0126 $this->_href = $value; 0127 return $this; 0128 } 0129 0130 public function getWhen() 0131 { 0132 return $this->_when; 0133 } 0134 0135 public function setWhen($value) 0136 { 0137 $this->_when = $value; 0138 return $this; 0139 } 0140 0141 0142 }