RendererAbstract.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  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
  13. * to padraic dot brady at yahoo dot com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Feed_Writer_Entry_Rss
  17. * @copyright Copyright (c) 2009 Padraic Brady
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /**
  21. * @see Zend_Feed_Writer_Extension_RendererInterface
  22. */
  23. require_once 'Zend/Feed/Writer/Extension/RendererInterface.php';
  24. /**
  25. * @category Zend
  26. * @package Zend_Feed_Writer_Entry_Rss
  27. * @copyright Copyright (c) 2009 Padraic Brady
  28. * @license http://framework.zend.com/license/new-bsd New BSD License
  29. */
  30. abstract class Zend_Feed_Writer_Extension_RendererAbstract
  31. implements Zend_Feed_Writer_Extension_RendererInterface
  32. {
  33. protected $_dom = null;
  34. protected $_entry = null;
  35. protected $_base = null;
  36. protected $_container = null;
  37. protected $_type = null;
  38. protected $_rootElement = null;
  39. /**
  40. * Encoding of all text values
  41. *
  42. * @var string
  43. */
  44. protected $_encoding = 'UTF-8';
  45. public function __construct($container)
  46. {
  47. $this->_container = $container;
  48. }
  49. public function setEncoding($enc)
  50. {
  51. $this->_encoding = $enc;
  52. }
  53. public function getEncoding()
  54. {
  55. return $this->_encoding;
  56. }
  57. public function setDomDocument(DOMDocument $dom, DOMElement $base)
  58. {
  59. $this->_dom = $dom;
  60. $this->_base = $base;
  61. }
  62. public function getDataContainer()
  63. {
  64. return $this->_container;
  65. }
  66. public function setType($type)
  67. {
  68. $this->_type = $type;
  69. }
  70. public function getType()
  71. {
  72. return $this->_type;
  73. }
  74. public function setRootElement(DOMElement $root)
  75. {
  76. $this->_rootElement = $root;
  77. }
  78. public function getRootElement()
  79. {
  80. return $this->_rootElement;
  81. }
  82. abstract protected function _appendNamespaces();
  83. }