|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Extension.php'; 00028 00032 require_once 'Zend/Gdata/Gapps.php'; 00033 00046 class Zend_Gdata_Gapps_Extension_Quota extends Zend_Gdata_Extension 00047 { 00048 00049 protected $_rootNamespace = 'apps'; 00050 protected $_rootElement = 'quota'; 00051 00057 protected $_limit = null; 00058 00064 public function __construct($limit = null) 00065 { 00066 $this->registerAllNamespaces(Zend_Gdata_Gapps::$namespaces); 00067 parent::__construct(); 00068 $this->_limit = $limit; 00069 } 00070 00081 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00082 { 00083 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00084 if ($this->_limit !== null) { 00085 $element->setAttribute('limit', $this->_limit); 00086 } 00087 return $element; 00088 } 00089 00097 protected function takeAttributeFromDOM($attribute) 00098 { 00099 switch ($attribute->localName) { 00100 case 'limit': 00101 $this->_limit = $attribute->nodeValue; 00102 break; 00103 default: 00104 parent::takeAttributeFromDOM($attribute); 00105 } 00106 } 00107 00114 public function getLimit() 00115 { 00116 return $this->_limit; 00117 } 00118 00127 public function setLimit($value) 00128 { 00129 $this->_limit = $value; 00130 return $this; 00131 } 00132 00137 public function __toString() 00138 { 00139 return $this->getLimit(); 00140 } 00141 00142 }