Merge file:///media/external_data/workspace/web/sport-group
[sport-group.git] / library / Zend / Gdata / App / Extension / Text.php
blob6c762abeafc33292c4cf3870ecbdb73f54500ec7
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
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.
16 * @category Zend
17 * @package Zend_Gdata
18 * @subpackage App
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 $
24 /**
25 * @see Zend_Gdata_App_Extension
27 require_once 'Zend/Gdata/App/Extension.php';
29 /**
30 * Abstract class for data models that require only text and type-- such as:
31 * title, summary, etc.
33 * @category Zend
34 * @package Zend_Gdata
35 * @subpackage App
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();
48 $this->_text = $text;
49 $this->_type = $type;
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);
58 return $element;
61 protected function takeAttributeFromDOM($attribute)
63 switch ($attribute->localName) {
64 case 'type':
65 $this->_type = $attribute->nodeValue;
66 break;
67 default:
68 parent::takeAttributeFromDOM($attribute);
73 * @return Zend_Gdata_App_Extension_Type
75 public function getType()
77 return $this->_type;
81 * @param string $value
82 * @return Zend_Gdata_App_Extension_Text Provides a fluent interface
84 public function setType($value)
86 $this->_type = $value;
87 return $this;