[44] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Zend Framework
|
---|
| 5 | *
|
---|
| 6 | * LICENSE
|
---|
| 7 | *
|
---|
| 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.
|
---|
| 15 | *
|
---|
| 16 | * @category Zend
|
---|
| 17 | * @package Zend_Gdata
|
---|
| 18 | * @subpackage App
|
---|
| 19 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
| 20 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
| 21 | */
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * @see Zend_Gdata_App_Extension
|
---|
| 25 | */
|
---|
| 26 | require_once 'Zend/Gdata/App/Extension.php';
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * Represents the atom:generator element
|
---|
| 30 | *
|
---|
| 31 | * @category Zend
|
---|
| 32 | * @package Zend_Gdata
|
---|
| 33 | * @subpackage App
|
---|
| 34 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
| 35 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
| 36 | */
|
---|
| 37 | class Zend_Gdata_App_Extension_Generator extends Zend_Gdata_App_Extension
|
---|
| 38 | {
|
---|
| 39 |
|
---|
| 40 | protected $_rootElement = 'generator';
|
---|
| 41 | protected $_uri = null;
|
---|
| 42 | protected $_version = null;
|
---|
| 43 |
|
---|
| 44 | public function __construct($text = null, $uri = null, $version = null)
|
---|
| 45 | {
|
---|
| 46 | parent::__construct();
|
---|
| 47 | $this->_text = $text;
|
---|
| 48 | $this->_uri = $uri;
|
---|
| 49 | $this->_version = $version;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
| 53 | {
|
---|
| 54 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
| 55 | if ($this->_uri !== null) {
|
---|
| 56 | $element->setAttribute('uri', $this->_uri);
|
---|
| 57 | }
|
---|
| 58 | if ($this->_version !== null) {
|
---|
| 59 | $element->setAttribute('version', $this->_version);
|
---|
| 60 | }
|
---|
| 61 | return $element;
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | protected function takeAttributeFromDOM($attribute)
|
---|
| 65 | {
|
---|
| 66 | switch ($attribute->localName) {
|
---|
| 67 | case 'uri':
|
---|
| 68 | $this->_uri = $attribute->nodeValue;
|
---|
| 69 | break;
|
---|
| 70 | case 'version':
|
---|
| 71 | $this->_version= $attribute->nodeValue;
|
---|
| 72 | break;
|
---|
| 73 | default:
|
---|
| 74 | parent::takeAttributeFromDOM($attribute);
|
---|
| 75 | }
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | /**
|
---|
| 79 | * @return Zend_Gdata_App_Extension_Uri
|
---|
| 80 | */
|
---|
| 81 | public function getUri()
|
---|
| 82 | {
|
---|
| 83 | return $this->_uri;
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | /**
|
---|
| 87 | * @param Zend_Gdata_App_Extension_Uri $value
|
---|
| 88 | * @return Zend_Gdata_App_Entry Provides a fluent interface
|
---|
| 89 | */
|
---|
| 90 | public function setUri($value)
|
---|
| 91 | {
|
---|
| 92 | $this->_uri = $value;
|
---|
| 93 | return $this;
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | /**
|
---|
| 97 | * @return Zend_Gdata_App_Extension_Version
|
---|
| 98 | */
|
---|
| 99 | public function getVersion()
|
---|
| 100 | {
|
---|
| 101 | return $this->_version;
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | /**
|
---|
| 105 | * @param Zend_Gdata_App_Extension_Version $value
|
---|
| 106 | * @return Zend_Gdata_App_Entry Provides a fluent interface
|
---|
| 107 | */
|
---|
| 108 | public function setVersion($value)
|
---|
| 109 | {
|
---|
| 110 | $this->_version = $value;
|
---|
| 111 | return $this;
|
---|
| 112 | }
|
---|
| 113 |
|
---|
| 114 | }
|
---|