~chroot64bit/zivios/gentoo-experimental

« back to all changes in this revision

Viewing changes to application/library/Zend/Gdata/App/Extension/Link.php

  • Committer: Mustafa A. Hashmi
  • Date: 2008-12-04 13:32:21 UTC
  • Revision ID: mhashmi@zivios.org-20081204133221-0nd1trunwevijj38
Inclusion of new installation framework with ties to zend layout and dojo layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * Zend Framework
 
5
 *
 
6
 * LICENSE
 
7
 *
 
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.
 
15
 *
 
16
 * @category   Zend
 
17
 * @package    Zend_Gdata
 
18
 * @subpackage App
 
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
 
21
 */
 
22
 
 
23
/**
 
24
 * @see Zend_Gdata_Extension
 
25
 */
 
26
require_once 'Zend/Gdata/Extension.php';
 
27
 
 
28
/**
 
29
 * Data model for representing an atom:link element
 
30
 *
 
31
 * @category   Zend
 
32
 * @package    Zend_Gdata
 
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
 
35
 */
 
36
class Zend_Gdata_App_Extension_Link extends Zend_Gdata_App_Extension
 
37
{
 
38
 
 
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;
 
46
 
 
47
    public function __construct($href = null, $rel = null, $type = null,
 
48
            $hrefLang = null, $title = null, $length = null)
 
49
    {
 
50
        parent::__construct();
 
51
        $this->_href = $href;
 
52
        $this->_rel = $rel;
 
53
        $this->_type = $type;
 
54
        $this->_hrefLang = $hrefLang;
 
55
        $this->_title = $title;
 
56
        $this->_length = $length;
 
57
    }
 
58
 
 
59
    public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
 
60
    {
 
61
        $element = parent::getDOM($doc, $majorVersion, $minorVersion);
 
62
        if ($this->_href !== null) {
 
63
            $element->setAttribute('href', $this->_href);
 
64
        }
 
65
        if ($this->_rel !== null) {
 
66
            $element->setAttribute('rel', $this->_rel);
 
67
        }
 
68
        if ($this->_type !== null) {
 
69
            $element->setAttribute('type', $this->_type);
 
70
        }
 
71
        if ($this->_hrefLang !== null) {
 
72
            $element->setAttribute('hreflang', $this->_hrefLang);
 
73
        }
 
74
        if ($this->_title !== null) {
 
75
            $element->setAttribute('title', $this->_title);
 
76
        }
 
77
        if ($this->_length !== null) {
 
78
            $element->setAttribute('length', $this->_length);
 
79
        }
 
80
        return $element;
 
81
    }
 
82
 
 
83
    protected function takeAttributeFromDOM($attribute)
 
84
    {
 
85
        switch ($attribute->localName) {
 
86
        case 'href':
 
87
            $this->_href = $attribute->nodeValue;
 
88
            break;
 
89
        case 'rel':
 
90
            $this->_rel = $attribute->nodeValue;
 
91
            break;
 
92
        case 'type':
 
93
            $this->_type = $attribute->nodeValue;
 
94
            break;
 
95
        case 'hreflang':
 
96
            $this->_hrefLang = $attribute->nodeValue;
 
97
            break;
 
98
        case 'title':
 
99
            $this->_title = $attribute->nodeValue;
 
100
            break;
 
101
        case 'length':
 
102
            $this->_length = $attribute->nodeValue;
 
103
            break;
 
104
        default:
 
105
            parent::takeAttributeFromDOM($attribute);
 
106
        }
 
107
    }
 
108
 
 
109
    /**
 
110
     * @return string|null
 
111
     */
 
112
    public function getHref()
 
113
    {
 
114
        return $this->_href;
 
115
    }
 
116
 
 
117
    /**
 
118
     * @param string|null $value
 
119
     * @return Zend_Gdata_App_Entry Provides a fluent interface
 
120
     */
 
121
    public function setHref($value)
 
122
    {
 
123
        $this->_href = $value;
 
124
        return $this;
 
125
    }
 
126
 
 
127
    /**
 
128
     * @return string|null
 
129
     */
 
130
    public function getRel()
 
131
    {
 
132
        return $this->_rel;
 
133
    }
 
134
 
 
135
    /**
 
136
     * @param string|null $value
 
137
     * @return Zend_Gdata_App_Entry Provides a fluent interface
 
138
     */
 
139
    public function setRel($value)
 
140
    {
 
141
        $this->_rel = $value;
 
142
        return $this;
 
143
    }
 
144
 
 
145
    /**
 
146
     * @return string|null
 
147
     */
 
148
    public function getType()
 
149
    {
 
150
        return $this->_type;
 
151
    }
 
152
 
 
153
    /**
 
154
     * @param string|null $value
 
155
     * @return Zend_Gdata_App_Entry Provides a fluent interface
 
156
     */
 
157
    public function setType($value)
 
158
    {
 
159
        $this->_type = $value;
 
160
        return $this;
 
161
    }
 
162
 
 
163
    /**
 
164
     * @return string|null
 
165
     */
 
166
    public function getHrefLang()
 
167
    {
 
168
        return $this->_hrefLang;
 
169
    }
 
170
 
 
171
    /**
 
172
     * @param string|null $value
 
173
     * @return Zend_Gdata_App_Entry Provides a fluent interface
 
174
     */
 
175
    public function setHrefLang($value)
 
176
    {
 
177
        $this->_hrefLang = $value;
 
178
        return $this;
 
179
    }
 
180
 
 
181
    /**
 
182
     * @return string|null
 
183
     */
 
184
    public function getTitle()
 
185
    {
 
186
        return $this->_title;
 
187
    }
 
188
 
 
189
    /**
 
190
     * @param string|null $value
 
191
     * @return Zend_Gdata_App_Entry Provides a fluent interface
 
192
     */
 
193
    public function setTitle($value)
 
194
    {
 
195
        $this->_title = $value;
 
196
        return $this;
 
197
    }
 
198
 
 
199
    /**
 
200
     * @return string|null
 
201
     */
 
202
    public function getLength()
 
203
    {
 
204
        return $this->_length;
 
205
    }
 
206
 
 
207
    /**
 
208
     * @param string|null $value
 
209
     * @return Zend_Gdata_App_Entry Provides a fluent interface
 
210
     */
 
211
    public function setLength($value)
 
212
    {
 
213
        $this->_length = $value;
 
214
        return $this;
 
215
    }
 
216
 
 
217
}