11 * If you did not receive a copy of the license and are unable to |
11 * If you did not receive a copy of the license and are unable to |
12 * obtain it through the world-wide-web, please send an email |
12 * obtain it through the world-wide-web, please send an email |
13 * to padraic dot brady at yahoo dot com so we can send you a copy immediately. |
13 * to padraic dot brady at yahoo dot com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Feed_Writer_Entry_Rss |
16 * @package Zend_Feed_Writer |
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @version $Id: RendererAbstract.php 20785 2010-01-31 09:43:03Z mikaelkael $ |
19 * @version $Id: RendererAbstract.php 24593 2012-01-05 20:35:02Z matthew $ |
20 */ |
20 */ |
21 |
21 |
22 /** |
22 /** |
23 * @see Zend_Feed_Writer_Extension_RendererInterface |
23 * @see Zend_Feed_Writer_Extension_RendererInterface |
24 */ |
24 */ |
25 require_once 'Zend/Feed/Writer/Extension/RendererInterface.php'; |
25 require_once 'Zend/Feed/Writer/Extension/RendererInterface.php'; |
26 |
26 |
27 /** |
27 /** |
28 * @category Zend |
28 * @category Zend |
29 * @package Zend_Feed_Writer_Entry_Rss |
29 * @package Zend_Feed_Writer |
30 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
30 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
31 * @license http://framework.zend.com/license/new-bsd New BSD License |
31 * @license http://framework.zend.com/license/new-bsd New BSD License |
32 */ |
32 */ |
33 abstract class Zend_Feed_Writer_Extension_RendererAbstract |
33 abstract class Zend_Feed_Writer_Extension_RendererAbstract |
34 implements Zend_Feed_Writer_Extension_RendererInterface |
34 implements Zend_Feed_Writer_Extension_RendererInterface |
35 { |
35 { |
36 /** |
36 /** |
37 * @var DOMDocument |
37 * @var DOMDocument |
38 */ |
38 */ |
39 protected $_dom = null; |
39 protected $_dom = null; |
40 |
40 |
41 /** |
41 /** |
42 * @var mixed |
42 * @var mixed |
43 */ |
43 */ |
44 protected $_entry = null; |
44 protected $_entry = null; |
45 |
45 |
46 /** |
46 /** |
47 * @var DOMElement |
47 * @var DOMElement |
48 */ |
48 */ |
49 protected $_base = null; |
49 protected $_base = null; |
50 |
50 |
51 /** |
51 /** |
52 * @var mixed |
52 * @var mixed |
53 */ |
53 */ |
54 protected $_container = null; |
54 protected $_container = null; |
55 |
55 |
56 /** |
56 /** |
57 * @var string |
57 * @var string |
58 */ |
58 */ |
59 protected $_type = null; |
59 protected $_type = null; |
60 |
60 |
61 /** |
61 /** |
62 * @var DOMElement |
62 * @var DOMElement |
63 */ |
63 */ |
64 protected $_rootElement = null; |
64 protected $_rootElement = null; |
65 |
65 |
66 /** |
66 /** |
67 * Encoding of all text values |
67 * Encoding of all text values |
68 * |
68 * |
69 * @var string |
69 * @var string |
70 */ |
70 */ |
71 protected $_encoding = 'UTF-8'; |
71 protected $_encoding = 'UTF-8'; |
72 |
72 |
73 /** |
73 /** |
74 * Constructor |
74 * Constructor |
75 * |
75 * |
76 * @param mixed $container |
76 * @param mixed $container |
77 * @return void |
77 * @return void |
78 */ |
78 */ |
79 public function __construct($container) |
79 public function __construct($container) |
80 { |
80 { |
81 $this->_container = $container; |
81 $this->_container = $container; |
82 } |
82 } |
83 |
83 |
84 /** |
84 /** |
85 * Set feed encoding |
85 * Set feed encoding |
86 * |
86 * |
87 * @param string $enc |
87 * @param string $enc |
88 * @return Zend_Feed_Writer_Extension_RendererAbstract |
88 * @return Zend_Feed_Writer_Extension_RendererAbstract |
89 */ |
89 */ |
90 public function setEncoding($enc) |
90 public function setEncoding($enc) |
91 { |
91 { |
92 $this->_encoding = $enc; |
92 $this->_encoding = $enc; |
93 return $this; |
93 return $this; |
94 } |
94 } |
95 |
95 |
96 /** |
96 /** |
97 * Get feed encoding |
97 * Get feed encoding |
98 * |
98 * |
99 * @return void |
99 * @return void |
100 */ |
100 */ |
101 public function getEncoding() |
101 public function getEncoding() |
102 { |
102 { |
103 return $this->_encoding; |
103 return $this->_encoding; |
104 } |
104 } |
105 |
105 |
106 /** |
106 /** |
107 * Set DOMDocument and DOMElement on which to operate |
107 * Set DOMDocument and DOMElement on which to operate |
108 * |
108 * |
109 * @param DOMDocument $dom |
109 * @param DOMDocument $dom |
110 * @param DOMElement $base |
110 * @param DOMElement $base |
111 * @return Zend_Feed_Writer_Extension_RendererAbstract |
111 * @return Zend_Feed_Writer_Extension_RendererAbstract |
112 */ |
112 */ |
113 public function setDomDocument(DOMDocument $dom, DOMElement $base) |
113 public function setDomDocument(DOMDocument $dom, DOMElement $base) |
114 { |
114 { |
115 $this->_dom = $dom; |
115 $this->_dom = $dom; |
116 $this->_base = $base; |
116 $this->_base = $base; |
117 return $this; |
117 return $this; |
118 } |
118 } |
119 |
119 |
120 /** |
120 /** |
121 * Get data container being rendered |
121 * Get data container being rendered |
122 * |
122 * |
123 * @return mixed |
123 * @return mixed |
124 */ |
124 */ |
125 public function getDataContainer() |
125 public function getDataContainer() |
126 { |
126 { |
127 return $this->_container; |
127 return $this->_container; |
128 } |
128 } |
129 |
129 |
130 /** |
130 /** |
131 * Set feed type |
131 * Set feed type |
132 * |
132 * |
133 * @param string $type |
133 * @param string $type |
134 * @return Zend_Feed_Writer_Extension_RendererAbstract |
134 * @return Zend_Feed_Writer_Extension_RendererAbstract |
135 */ |
135 */ |
136 public function setType($type) |
136 public function setType($type) |
137 { |
137 { |
138 $this->_type = $type; |
138 $this->_type = $type; |
139 return $this; |
139 return $this; |
140 } |
140 } |
141 |
141 |
142 /** |
142 /** |
143 * Get feedtype |
143 * Get feedtype |
144 * |
144 * |
145 * @return string |
145 * @return string |
146 */ |
146 */ |
147 public function getType() |
147 public function getType() |
148 { |
148 { |
149 return $this->_type; |
149 return $this->_type; |
150 } |
150 } |
151 |
151 |
152 /** |
152 /** |
153 * Set root element of document |
153 * Set root element of document |
154 * |
154 * |
155 * @param DOMElement $root |
155 * @param DOMElement $root |
156 * @return Zend_Feed_Writer_Extension_RendererAbstract |
156 * @return Zend_Feed_Writer_Extension_RendererAbstract |
157 */ |
157 */ |
158 public function setRootElement(DOMElement $root) |
158 public function setRootElement(DOMElement $root) |
159 { |
159 { |
160 $this->_rootElement = $root; |
160 $this->_rootElement = $root; |
161 return $this; |
161 return $this; |
162 } |
162 } |
163 |
163 |
164 /** |
164 /** |
165 * Get root element |
165 * Get root element |
166 * |
166 * |
167 * @return DOMElement |
167 * @return DOMElement |
168 */ |
168 */ |
169 public function getRootElement() |
169 public function getRootElement() |
170 { |
170 { |
171 return $this->_rootElement; |
171 return $this->_rootElement; |
172 } |
172 } |
173 |
173 |
174 /** |
174 /** |
175 * Append namespaces to feed |
175 * Append namespaces to feed |
176 * |
176 * |
177 * @return void |
177 * @return void |
178 */ |
178 */ |
179 abstract protected function _appendNamespaces(); |
179 abstract protected function _appendNamespaces(); |
180 } |
180 } |