File indexing completed on 2025-03-02 05:29:25
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Gdata 0017 * @subpackage Analytics 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** 0024 * @see Zend_Gdata_Extension 0025 */ 0026 // require_once 'Zend/Gdata/Extension.php'; 0027 0028 /** 0029 * @category Zend 0030 * @package Zend_Gdata 0031 * @subpackage Analytics 0032 */ 0033 class Zend_Gdata_Analytics_Extension_TableId extends Zend_Gdata_Extension 0034 { 0035 0036 protected $_rootNamespace = 'ga'; 0037 protected $_rootElement = 'tableId'; 0038 protected $_value = null; 0039 0040 /** 0041 * Constructs a new Zend_Gdata_Calendar_Extension_Timezone object. 0042 * @param string $value (optional) The text content of the element. 0043 */ 0044 public function __construct($value = null) 0045 { 0046 $this->registerAllNamespaces(Zend_Gdata_Analytics::$namespaces); 0047 parent::__construct(); 0048 $this->_value = $value; 0049 } 0050 0051 /** 0052 * Retrieves a DOMElement which corresponds to this element and all 0053 * child properties. This is used to build an entry back into a DOM 0054 * and eventually XML text for sending to the server upon updates, or 0055 * for application storage/persistence. 0056 * 0057 * @param DOMDocument $doc The DOMDocument used to construct DOMElements 0058 * @return DOMElement The DOMElement representing this element and all 0059 * child properties. 0060 */ 0061 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 0062 { 0063 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 0064 if ($this->_value != null) { 0065 $element->setAttribute('value', $this->_value); 0066 } 0067 return $element; 0068 } 0069 0070 /** 0071 * Given a DOMNode representing an attribute, tries to map the data into 0072 * instance members. If no mapping is defined, the name and value are 0073 * stored in an array. 0074 * 0075 * @param DOMNode $attribute The DOMNode attribute needed to be handled 0076 */ 0077 protected function takeChildFromDOM($child) 0078 { 0079 $this->_value = $child->nodeValue; 0080 } 0081 0082 /** 0083 * Get the value for this element's value attribute. 0084 * 0085 * @return string The value associated with this attribute. 0086 */ 0087 public function getValue() 0088 { 0089 return $this->_value; 0090 } 0091 0092 /** 0093 * Set the value for this element's value attribute. 0094 * 0095 * @param string $value The desired value for this attribute. 0096 * @return Zend_Gdata_Calendar_Extension_Timezone The element being modified. 0097 */ 0098 public function setValue($value) 0099 { 0100 $this->_value = $value; 0101 return $this; 0102 } 0103 0104 /** 0105 * Magic toString method allows using this directly via echo 0106 * Works best in PHP >= 4.2.0 0107 */ 0108 public function __toString() 0109 { 0110 return $this->getValue(); 0111 } 0112 }