web/lib/Zend/Feed/Reader/Entry/Atom.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_Reader
    16  * @package    Zend_Feed_Reader
    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: Atom.php 20096 2010-01-06 02:05:09Z bkarwin $
    19  * @version    $Id: Atom.php 24593 2012-01-05 20:35:02Z matthew $
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @see Zend_Feed_Reader
    23  * @see Zend_Feed_Reader
    24  */
    24  */
    40 require_once 'Zend/Feed/Reader/Extension/Atom/Entry.php';
    40 require_once 'Zend/Feed/Reader/Extension/Atom/Entry.php';
    41 
    41 
    42 /**
    42 /**
    43  * @category   Zend
    43  * @category   Zend
    44  * @package    Zend_Feed_Reader
    44  * @package    Zend_Feed_Reader
    45  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    45  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    46  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    46  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    47  */
    47  */
    48 class Zend_Feed_Reader_Entry_Atom extends Zend_Feed_Reader_EntryAbstract implements Zend_Feed_Reader_EntryInterface
    48 class Zend_Feed_Reader_Entry_Atom extends Zend_Feed_Reader_EntryAbstract implements Zend_Feed_Reader_EntryInterface
    49 {
    49 {
    50     /**
    50     /**
    72         $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Entry');
    72         $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Entry');
    73         $this->_extensions['Atom_Entry'] = new $atomClass($entry, $entryKey, $type);
    73         $this->_extensions['Atom_Entry'] = new $atomClass($entry, $entryKey, $type);
    74 
    74 
    75         $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Thread_Entry');
    75         $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Thread_Entry');
    76         $this->_extensions['Thread_Entry'] = new $threadClass($entry, $entryKey, $type);
    76         $this->_extensions['Thread_Entry'] = new $threadClass($entry, $entryKey, $type);
    77         
    77 
    78         $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Entry');
    78         $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Entry');
    79         $this->_extensions['DublinCore_Entry'] = new $threadClass($entry, $entryKey, $type);
    79         $this->_extensions['DublinCore_Entry'] = new $threadClass($entry, $entryKey, $type);
    80     }
    80     }
    81 
    81 
    82     /**
    82     /**
   342 
   342 
   343         $this->_data['commentfeedlink'] = $commentfeedlink;
   343         $this->_data['commentfeedlink'] = $commentfeedlink;
   344 
   344 
   345         return $this->_data['commentfeedlink'];
   345         return $this->_data['commentfeedlink'];
   346     }
   346     }
   347     
   347 
   348     /**
   348     /**
   349      * Get category data as a Zend_Feed_Reader_Collection_Category object
   349      * Get category data as a Zend_Feed_Reader_Collection_Category object
   350      *
   350      *
   351      * @return Zend_Feed_Reader_Collection_Category
   351      * @return Zend_Feed_Reader_Collection_Category
   352      */
   352      */
   355         if (array_key_exists('categories', $this->_data)) {
   355         if (array_key_exists('categories', $this->_data)) {
   356             return $this->_data['categories'];
   356             return $this->_data['categories'];
   357         }
   357         }
   358 
   358 
   359         $categoryCollection = $this->getExtension('Atom')->getCategories();
   359         $categoryCollection = $this->getExtension('Atom')->getCategories();
   360         
   360 
   361         if (count($categoryCollection) == 0) {
   361         if (count($categoryCollection) == 0) {
   362             $categoryCollection = $this->getExtension('DublinCore')->getCategories();
   362             $categoryCollection = $this->getExtension('DublinCore')->getCategories();
   363         }
   363         }
   364 
   364 
   365         $this->_data['categories'] = $categoryCollection;
   365         $this->_data['categories'] = $categoryCollection;
   366 
   366 
   367         return $this->_data['categories'];
   367         return $this->_data['categories'];
   368     }
   368     }
   369     
   369 
   370     /**
   370     /**
   371      * Get source feed metadata from the entry
   371      * Get source feed metadata from the entry
   372      *
   372      *
   373      * @return Zend_Feed_Reader_Feed_Atom_Source|null
   373      * @return Zend_Feed_Reader_Feed_Atom_Source|null
   374      */
   374      */
   380 
   380 
   381         $source = $this->getExtension('Atom')->getSource();
   381         $source = $this->getExtension('Atom')->getSource();
   382 
   382 
   383         $this->_data['source'] = $source;
   383         $this->_data['source'] = $source;
   384 
   384 
   385         return $this->_data['source']; 
   385         return $this->_data['source'];
   386     }
   386     }
   387 
   387 
   388     /**
   388     /**
   389      * Set the XPath query (incl. on all Extensions)
   389      * Set the XPath query (incl. on all Extensions)
   390      *
   390      *