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-2009 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id: Text.php 16971 2009-07-22 18:05:45Z mikaelkael $
25 * @see Zend_Gdata_App_Extension
27 require_once 'Zend/Gdata/App/Extension.php';
30 * Abstract class for data models that require only text and type-- such as:
31 * title, summary, etc.
36 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 abstract class Zend_Gdata_App_Extension_Text
extends Zend_Gdata_App_Extension
42 protected $_rootElement = null;
43 protected $_type = 'text';
45 public function __construct($text = null, $type = 'text')
47 parent
::__construct();
52 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
54 $element = parent
::getDOM($doc, $majorVersion, $minorVersion);
55 if ($this->_type
!== null) {
56 $element->setAttribute('type', $this->_type
);
61 protected function takeAttributeFromDOM($attribute)
63 switch ($attribute->localName
) {
65 $this->_type
= $attribute->nodeValue
;
68 parent
::takeAttributeFromDOM($attribute);
73 * @return Zend_Gdata_App_Extension_Type
75 public function getType()
81 * @param string $value
82 * @return Zend_Gdata_App_Extension_Text Provides a fluent interface
84 public function setType($value)
86 $this->_type
= $value;