856e714104dbbd05bb6e4b50dfecaaf22dc4fd20
[yaffs-website] / vendor / zendframework / zend-feed / src / Writer / Extension / AbstractRenderer.php
1 <?php
2 /**
3  * Zend Framework (http://framework.zend.com/)
4  *
5  * @link      http://github.com/zendframework/zf2 for the canonical source repository
6  * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7  * @license   http://framework.zend.com/license/new-bsd New BSD License
8  */
9
10 namespace Zend\Feed\Writer\Extension;
11
12 use DOMDocument;
13 use DOMElement;
14
15 /**
16 */
17 abstract class AbstractRenderer implements RendererInterface
18 {
19     /**
20      * @var DOMDocument
21      */
22     protected $dom = null;
23
24     /**
25      * @var mixed
26      */
27     protected $entry = null;
28
29     /**
30      * @var DOMElement
31      */
32     protected $base = null;
33
34     /**
35      * @var mixed
36      */
37     protected $container = null;
38
39     /**
40      * @var string
41      */
42     protected $type = null;
43
44     /**
45      * @var DOMElement
46      */
47     protected $rootElement = null;
48
49     /**
50      * Encoding of all text values
51      *
52      * @var string
53      */
54     protected $encoding = 'UTF-8';
55
56     /**
57      * Set the data container
58      *
59      * @param  mixed $container
60      * @return AbstractRenderer
61      */
62     public function setDataContainer($container)
63     {
64         $this->container = $container;
65         return $this;
66     }
67
68     /**
69      * Set feed encoding
70      *
71      * @param  string $enc
72      * @return AbstractRenderer
73      */
74     public function setEncoding($enc)
75     {
76         $this->encoding = $enc;
77         return $this;
78     }
79
80     /**
81      * Get feed encoding
82      *
83      * @return string
84      */
85     public function getEncoding()
86     {
87         return $this->encoding;
88     }
89
90     /**
91      * Set DOMDocument and DOMElement on which to operate
92      *
93      * @param  DOMDocument $dom
94      * @param  DOMElement $base
95      * @return AbstractRenderer
96      */
97     public function setDomDocument(DOMDocument $dom, DOMElement $base)
98     {
99         $this->dom  = $dom;
100         $this->base = $base;
101         return $this;
102     }
103
104     /**
105      * Get data container being rendered
106      *
107      * @return mixed
108      */
109     public function getDataContainer()
110     {
111         return $this->container;
112     }
113
114     /**
115      * Set feed type
116      *
117      * @param  string $type
118      * @return AbstractRenderer
119      */
120     public function setType($type)
121     {
122         $this->type = $type;
123         return $this;
124     }
125
126     /**
127      * Get feedtype
128      *
129      * @return string
130      */
131     public function getType()
132     {
133         return $this->type;
134     }
135
136     /**
137      * Set root element of document
138      *
139      * @param  DOMElement $root
140      * @return AbstractRenderer
141      */
142     public function setRootElement(DOMElement $root)
143     {
144         $this->rootElement = $root;
145         return $this;
146     }
147
148     /**
149      * Get root element
150      *
151      * @return DOMElement
152      */
153     public function getRootElement()
154     {
155         return $this->rootElement;
156     }
157
158     /**
159      * Append namespaces to feed
160      *
161      * @return void
162      */
163     // @codingStandardsIgnoreStart
164     abstract protected function _appendNamespaces();
165     // @codingStandardsIgnoreEnd
166 }