File indexing completed on 2025-03-02 05:29:25
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 App 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_App_Extension 0026 */ 0027 // require_once 'Zend/Gdata/App/Extension.php'; 0028 0029 /** 0030 * Represents the atom:generator element 0031 * 0032 * @category Zend 0033 * @package Zend_Gdata 0034 * @subpackage App 0035 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0036 * @license http://framework.zend.com/license/new-bsd New BSD License 0037 */ 0038 class Zend_Gdata_App_Extension_Generator extends Zend_Gdata_App_Extension 0039 { 0040 0041 protected $_rootElement = 'generator'; 0042 protected $_uri = null; 0043 protected $_version = null; 0044 0045 public function __construct($text = null, $uri = null, $version = null) 0046 { 0047 parent::__construct(); 0048 $this->_text = $text; 0049 $this->_uri = $uri; 0050 $this->_version = $version; 0051 } 0052 0053 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 0054 { 0055 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 0056 if ($this->_uri !== null) { 0057 $element->setAttribute('uri', $this->_uri); 0058 } 0059 if ($this->_version !== null) { 0060 $element->setAttribute('version', $this->_version); 0061 } 0062 return $element; 0063 } 0064 0065 protected function takeAttributeFromDOM($attribute) 0066 { 0067 switch ($attribute->localName) { 0068 case 'uri': 0069 $this->_uri = $attribute->nodeValue; 0070 break; 0071 case 'version': 0072 $this->_version= $attribute->nodeValue; 0073 break; 0074 default: 0075 parent::takeAttributeFromDOM($attribute); 0076 } 0077 } 0078 0079 /** 0080 * @return Zend_Gdata_App_Extension_Uri 0081 */ 0082 public function getUri() 0083 { 0084 return $this->_uri; 0085 } 0086 0087 /** 0088 * @param Zend_Gdata_App_Extension_Uri $value 0089 * @return Zend_Gdata_App_Entry Provides a fluent interface 0090 */ 0091 public function setUri($value) 0092 { 0093 $this->_uri = $value; 0094 return $this; 0095 } 0096 0097 /** 0098 * @return Zend_Gdata_App_Extension_Version 0099 */ 0100 public function getVersion() 0101 { 0102 return $this->_version; 0103 } 0104 0105 /** 0106 * @param Zend_Gdata_App_Extension_Version $value 0107 * @return Zend_Gdata_App_Entry Provides a fluent interface 0108 */ 0109 public function setVersion($value) 0110 { 0111 $this->_version = $value; 0112 return $this; 0113 } 0114 0115 }