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.
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_App_Extension
27 require_once 'Zend/Gdata/App/Extension.php';
30 * @see Zend_Gdata_App_Extension_Draft
32 require_once 'Zend/Gdata/App/Extension/Draft.php';
35 * Represents the app:control element
40 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
41 * @license http://framework.zend.com/license/new-bsd New BSD License
43 class Zend_Gdata_App_Extension_Control extends Zend_Gdata_App_Extension
46 protected $_rootNamespace = 'app';
47 protected $_rootElement = 'control';
48 protected $_draft = null;
50 public function __construct($draft = null)
52 parent::__construct();
53 $this->_draft = $draft;
56 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
58 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
59 if ($this->_draft != null) {
60 $element->appendChild($this->_draft->getDOM($element->ownerDocument));
65 protected function takeChildFromDOM($child)
67 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
68 switch ($absoluteNodeName) {
69 case $this->lookupNamespace('app') . ':' . 'draft':
70 $draft = new Zend_Gdata_App_Extension_Draft();
71 $draft->transferFromDOM($child);
72 $this->_draft = $draft;
75 parent::takeChildFromDOM($child);
81 * @return Zend_Gdata_App_Extension_Draft
83 public function getDraft()
89 * @param Zend_Gdata_App_Extension_Draft $value
90 * @return Zend_Gdata_App_Entry Provides a fluent interface
92 public function setDraft($value)
94 $this->_draft = $value;