web/lib/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    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 license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Feed_Writer
    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: Entry.php 20325 2010-01-16 00:17:59Z padraic $
    19  * @version    $Id: Entry.php 24593 2012-01-05 20:35:02Z matthew $
    20  */
    20  */
    21  
    21 
    22 /**
    22 /**
    23  * @see Zend_Feed_Writer_Extension_RendererAbstract
    23  * @see Zend_Feed_Writer_Extension_RendererAbstract
    24  */
    24  */
    25 require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
    25 require_once 'Zend/Feed/Writer/Extension/RendererAbstract.php';
    26  
    26 
    27 /**
    27 /**
    28  * @category   Zend
    28  * @category   Zend
    29  * @package    Zend_Feed_Writer
    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 class Zend_Feed_Writer_Extension_WellFormedWeb_Renderer_Entry
    33 class Zend_Feed_Writer_Extension_WellFormedWeb_Renderer_Entry
    34     extends Zend_Feed_Writer_Extension_RendererAbstract
    34     extends Zend_Feed_Writer_Extension_RendererAbstract
    35 {
    35 {
    40      * until an element which requires it is actually appended.
    40      * until an element which requires it is actually appended.
    41      *
    41      *
    42      * @var bool
    42      * @var bool
    43      */
    43      */
    44     protected $_called = false;
    44     protected $_called = false;
    45     
    45 
    46     /**
    46     /**
    47      * Render entry
    47      * Render entry
    48      * 
    48      *
    49      * @return void
    49      * @return void
    50      */
    50      */
    51     public function render()
    51     public function render()
    52     {
    52     {
    53         if (strtolower($this->getType()) == 'atom') {
    53         if (strtolower($this->getType()) == 'atom') {
    56         $this->_setCommentFeedLinks($this->_dom, $this->_base);
    56         $this->_setCommentFeedLinks($this->_dom, $this->_base);
    57         if ($this->_called) {
    57         if ($this->_called) {
    58             $this->_appendNamespaces();
    58             $this->_appendNamespaces();
    59         }
    59         }
    60     }
    60     }
    61     
    61 
    62     /**
    62     /**
    63      * Append entry namespaces
    63      * Append entry namespaces
    64      * 
    64      *
    65      * @return void
    65      * @return void
    66      */
    66      */
    67     protected function _appendNamespaces()
    67     protected function _appendNamespaces()
    68     {
    68     {
    69         $this->getRootElement()->setAttribute('xmlns:wfw',
    69         $this->getRootElement()->setAttribute('xmlns:wfw',
    70             'http://wellformedweb.org/CommentAPI/');  
    70             'http://wellformedweb.org/CommentAPI/');
    71     }
    71     }
    72     
    72 
    73     /**
    73     /**
    74      * Set entry comment feed links
    74      * Set entry comment feed links
    75      * 
    75      *
    76      * @param  DOMDocument $dom 
    76      * @param  DOMDocument $dom
    77      * @param  DOMElement $root 
    77      * @param  DOMElement $root
    78      * @return void
    78      * @return void
    79      */
    79      */
    80     protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root)
    80     protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root)
    81     {
    81     {
    82         $links = $this->getDataContainer()->getCommentFeedLinks();
    82         $links = $this->getDataContainer()->getCommentFeedLinks();