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-2008 Zend Technologies USA Inc. (http://www.zend.com)
20
* @license http://framework.zend.com/license/new-bsd New BSD License
24
* @see Zend_Gdata_Extension
26
require_once 'Zend/Gdata/Extension.php';
29
* Data model for representing an atom:link element
33
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
34
* @license http://framework.zend.com/license/new-bsd New BSD License
36
class Zend_Gdata_App_Extension_Link extends Zend_Gdata_App_Extension
39
protected $_rootElement = 'link';
40
protected $_href = null;
41
protected $_rel = null;
42
protected $_type = null;
43
protected $_hrefLang = null;
44
protected $_title = null;
45
protected $_length = null;
47
public function __construct($href = null, $rel = null, $type = null,
48
$hrefLang = null, $title = null, $length = null)
50
parent::__construct();
54
$this->_hrefLang = $hrefLang;
55
$this->_title = $title;
56
$this->_length = $length;
59
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
61
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
62
if ($this->_href !== null) {
63
$element->setAttribute('href', $this->_href);
65
if ($this->_rel !== null) {
66
$element->setAttribute('rel', $this->_rel);
68
if ($this->_type !== null) {
69
$element->setAttribute('type', $this->_type);
71
if ($this->_hrefLang !== null) {
72
$element->setAttribute('hreflang', $this->_hrefLang);
74
if ($this->_title !== null) {
75
$element->setAttribute('title', $this->_title);
77
if ($this->_length !== null) {
78
$element->setAttribute('length', $this->_length);
83
protected function takeAttributeFromDOM($attribute)
85
switch ($attribute->localName) {
87
$this->_href = $attribute->nodeValue;
90
$this->_rel = $attribute->nodeValue;
93
$this->_type = $attribute->nodeValue;
96
$this->_hrefLang = $attribute->nodeValue;
99
$this->_title = $attribute->nodeValue;
102
$this->_length = $attribute->nodeValue;
105
parent::takeAttributeFromDOM($attribute);
110
* @return string|null
112
public function getHref()
118
* @param string|null $value
119
* @return Zend_Gdata_App_Entry Provides a fluent interface
121
public function setHref($value)
123
$this->_href = $value;
128
* @return string|null
130
public function getRel()
136
* @param string|null $value
137
* @return Zend_Gdata_App_Entry Provides a fluent interface
139
public function setRel($value)
141
$this->_rel = $value;
146
* @return string|null
148
public function getType()
154
* @param string|null $value
155
* @return Zend_Gdata_App_Entry Provides a fluent interface
157
public function setType($value)
159
$this->_type = $value;
164
* @return string|null
166
public function getHrefLang()
168
return $this->_hrefLang;
172
* @param string|null $value
173
* @return Zend_Gdata_App_Entry Provides a fluent interface
175
public function setHrefLang($value)
177
$this->_hrefLang = $value;
182
* @return string|null
184
public function getTitle()
186
return $this->_title;
190
* @param string|null $value
191
* @return Zend_Gdata_App_Entry Provides a fluent interface
193
public function setTitle($value)
195
$this->_title = $value;
200
* @return string|null
202
public function getLength()
204
return $this->_length;
208
* @param string|null $value
209
* @return Zend_Gdata_App_Entry Provides a fluent interface
211
public function setLength($value)
213
$this->_length = $value;