Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/zend/Zend/Gdata/YouTube/Extension/Control.php
Go to the documentation of this file.
00001 <?php
00026 require_once 'Zend/Gdata/App/Extension/Control.php';
00027 
00031 require_once 'Zend/Gdata/YouTube/Extension/State.php';
00032 
00033 
00043 class Zend_Gdata_YouTube_Extension_Control extends Zend_Gdata_App_Extension_Control
00044 {
00045 
00046     protected $_state = null;
00047 
00054     public function __construct($draft = null, $state = null)
00055     {
00056         $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);
00057         parent::__construct($draft);
00058         $this->_state = $state;
00059     }
00060 
00071     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
00072     {
00073         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
00074         if ($this->_state != null) {
00075             $element->appendChild($this->_state->getDOM($element->ownerDocument));
00076         }
00077         return $element;
00078     }
00079 
00086     protected function takeChildFromDOM($child)
00087     {
00088         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
00089         switch ($absoluteNodeName) {
00090         case $this->lookupNamespace('yt') . ':' . 'state':
00091             $state = new Zend_Gdata_YouTube_Extension_State();
00092             $state->transferFromDOM($child);
00093             $this->_state = $state;
00094             break;
00095         default:
00096             parent::takeChildFromDOM($child);
00097             break;
00098         }
00099     }
00100 
00106     public function getState()
00107     {
00108         return $this->_state;
00109     }
00110 
00117     public function setState($value)
00118     {
00119         $this->_state = $value;
00120         return $this;
00121     }
00122 
00128     public function getStateValue()
00129     {
00130       return $this->getState()->getText();
00131     }
00132 
00133 }
 All Data Structures Namespaces Files Functions Variables Enumerations