* A PHP-Based RSS and Atom Feed Framework.
* Takes the hard work out of managing a complete RSS/Atom solution.
*
- * Copyright (c) 2004-2009, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
+ * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
- * @version 1.3-dev
- * @copyright 2004-2010 Ryan Parman, Geoffrey Sneddon, Ryan McCue
+ * @version 1.3.1
+ * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
* @author Ryan Parman
* @author Geoffrey Sneddon
* @author Ryan McCue
* @link http://simplepie.org/ SimplePie
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @todo phpDoc comments
*/
+/**
+ * Manages all item-related data
+ *
+ * Used by {@see SimplePie::get_item()} and {@see SimplePie::get_items()}
+ *
+ * This class can be overloaded with {@see SimplePie::set_item_class()}
+ *
+ * @package SimplePie
+ * @subpackage API
+ */
class SimplePie_Item
{
+ /**
+ * Parent feed
+ *
+ * @access private
+ * @var SimplePie
+ */
var $feed;
+
+ /**
+ * Raw data
+ *
+ * @access private
+ * @var array
+ */
var $data = array();
+ /**
+ * Registry object
+ *
+ * @see set_registry
+ * @var SimplePie_Registry
+ */
+ protected $registry;
+
+ /**
+ * Create a new item object
+ *
+ * This is usually used by {@see SimplePie::get_items} and
+ * {@see SimplePie::get_item}. Avoid creating this manually.
+ *
+ * @param SimplePie $feed Parent feed
+ * @param array $data Raw data
+ */
public function __construct($feed, $data)
{
$this->feed = $feed;
$this->data = $data;
}
+ /**
+ * Set the registry handler
+ *
+ * This is usually used by {@see SimplePie_Registry::create}
+ *
+ * @since 1.3
+ * @param SimplePie_Registry $registry
+ */
+ public function set_registry(SimplePie_Registry $registry)
+ {
+ $this->registry = $registry;
+ }
+
+ /**
+ * Get a string representation of the item
+ *
+ * @return string
+ */
public function __toString()
{
return md5(serialize($this->data));
}
}
+ /**
+ * Get data for an item-level element
+ *
+ * This method allows you to get access to ANY element/attribute that is a
+ * sub-element of the item/entry tag.
+ *
+ * See {@see SimplePie::get_feed_tags()} for a description of the return value
+ *
+ * @since 1.0
+ * @see http://simplepie.org/wiki/faq/supported_xml_namespaces
+ * @param string $namespace The URL of the XML namespace of the elements you're trying to access
+ * @param string $tag Tag name
+ * @return array
+ */
public function get_item_tags($namespace, $tag)
{
if (isset($this->data['child'][$namespace][$tag]))
}
}
+ /**
+ * Get the base URL value from the parent feed
+ *
+ * Uses `<xml:base>`
+ *
+ * @param array $element
+ * @return string
+ */
public function get_base($element = array())
{
return $this->feed->get_base($element);
}
+ /**
+ * Sanitize feed data
+ *
+ * @access private
+ * @see SimplePie::sanitize()
+ * @param string $data Data to sanitize
+ * @param int $type One of the SIMPLEPIE_CONSTRUCT_* constants
+ * @param string $base Base URL to resolve URLs against
+ * @return string Sanitized data
+ */
public function sanitize($data, $type, $base = '')
{
return $this->feed->sanitize($data, $type, $base);
}
+ /**
+ * Get the parent feed
+ *
+ * Note: this may not work as you think for multifeeds!
+ *
+ * @link http://simplepie.org/faq/typical_multifeed_gotchas#missing_data_from_feed
+ * @since 1.0
+ * @return SimplePie
+ */
public function get_feed()
{
return $this->feed;
}
+ /**
+ * Get the unique identifier for the item
+ *
+ * This is usually used when writing code to check for new items in a feed.
+ *
+ * Uses `<atom:id>`, `<guid>`, `<dc:identifier>` or the `about` attribute
+ * for RDF. If none of these are supplied (or `$hash` is true), creates an
+ * MD5 hash based on the permalink and title. If either of those are not
+ * supplied, creates a hash based on the full feed data.
+ *
+ * @since Beta 2
+ * @param boolean $hash Should we force using a hash instead of the supplied ID?
+ * @return string
+ */
public function get_id($hash = false)
{
if (!$hash)
}
}
+ /**
+ * Get the title of the item
+ *
+ * Uses `<atom:title>`, `<title>` or `<dc:title>`
+ *
+ * @since Beta 2 (previously called `get_item_title` since 0.8)
+ * @return string|null
+ */
public function get_title()
{
if (!isset($this->data['title']))
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title'))
{
- $this->data['title'] = $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title'))
{
- $this->data['title'] = $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title'))
{
return $this->data['title'];
}
+ /**
+ * Get the content for the item
+ *
+ * Prefers summaries over full content , but will return full content if a
+ * summary does not exist.
+ *
+ * To prefer full content instead, use {@see get_content}
+ *
+ * Uses `<atom:summary>`, `<description>`, `<dc:description>` or
+ * `<itunes:subtitle>`
+ *
+ * @since 0.8
+ * @param boolean $description_only Should we avoid falling back to the content?
+ * @return string|null
+ */
public function get_description($description_only = false)
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description'))
{
}
}
+ /**
+ * Get the content for the item
+ *
+ * Prefers full content over summaries, but will return a summary if full
+ * content does not exist.
+ *
+ * To prefer summaries instead, use {@see get_description}
+ *
+ * Uses `<atom:content>` or `<content:encoded>` (RSS 1.0 Content Module)
+ *
+ * @since 1.0
+ * @param boolean $content_only Should we avoid falling back to the description?
+ * @return string|null
+ */
public function get_content($content_only = false)
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_content_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_03_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded'))
{
}
}
+ /**
+ * Get a category for the item
+ *
+ * @since Beta 3 (previously called `get_categories()` since Beta 2)
+ * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Category|null
+ */
public function get_category($key = 0)
{
$categories = $this->get_categories();
}
}
+ /**
+ * Get all categories for the item
+ *
+ * Uses `<atom:category>`, `<category>` or `<dc:subject>`
+ *
+ * @since Beta 3
+ * @return array|null List of {@see SimplePie_Category} objects
+ */
public function get_categories()
{
$categories = array();
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category)
{
{
$scheme = null;
}
- $categories[] = new $this->feed->category_class($term, $scheme, null);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, null));
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category)
{
- $categories[] = new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category)
{
- $categories[] = new $this->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
if (!empty($categories))
{
- return SimplePie_Misc::array_unique($categories);
+ return array_unique($categories);
}
else
{
}
}
+ /**
+ * Get an author for the item
+ *
+ * @since Beta 2
+ * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Author|null
+ */
public function get_author($key = 0)
{
$authors = $this->get_authors();
}
}
+ /**
+ * Get a contributor for the item
+ *
+ * @since 1.1
+ * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Author|null
+ */
public function get_contributor($key = 0)
{
$contributors = $this->get_contributors();
}
}
+ /**
+ * Get all contributors for the item
+ *
+ * Uses `<atom:contributor>`
+ *
+ * @since 1.1
+ * @return array|null List of {@see SimplePie_Author} objects
+ */
public function get_contributors()
{
$contributors = array();
}
if ($name !== null || $email !== null || $uri !== null)
{
- $contributors[] = new $this->feed->author_class($name, $uri, $email);
+ $contributors[] = $this->registry->create('Author', array($name, $uri, $email));
}
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor)
}
if ($name !== null || $email !== null || $url !== null)
{
- $contributors[] = new $this->feed->author_class($name, $url, $email);
+ $contributors[] = $this->registry->create('Author', array($name, $url, $email));
}
}
if (!empty($contributors))
{
- return SimplePie_Misc::array_unique($contributors);
+ return array_unique($contributors);
}
else
{
}
}
+ /**
+ * Get all authors for the item
+ *
+ * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>`
+ *
+ * @since Beta 2
+ * @return array|null List of {@see SimplePie_Author} objects
+ */
public function get_authors()
{
$authors = array();
}
if ($name !== null || $email !== null || $uri !== null)
{
- $authors[] = new $this->feed->author_class($name, $uri, $email);
+ $authors[] = $this->registry->create('Author', array($name, $uri, $email));
}
}
if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author'))
}
if ($name !== null || $email !== null || $url !== null)
{
- $authors[] = new $this->feed->author_class($name, $url, $email);
+ $authors[] = $this->registry->create('Author', array($name, $url, $email));
}
}
if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author'))
{
- $authors[] = new $this->feed->author_class(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT));
+ $authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)));
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author)
{
- $authors[] = new $this->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author)
{
- $authors[] = new $this->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author)
{
- $authors[] = new $this->feed->author_class($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
+ $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null));
}
if (!empty($authors))
{
- return SimplePie_Misc::array_unique($authors);
+ return array_unique($authors);
}
elseif (($source = $this->get_source()) && ($authors = $source->get_authors()))
{
}
}
+ /**
+ * Get the copyright info for the item
+ *
+ * Uses `<atom:rights>` or `<dc:rights>`
+ *
+ * @since 1.1
+ * @return string
+ */
public function get_copyright()
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights'))
{
- return $this->sanitize($return[0]['data'], SimplePie_Misc::atom_10_construct_type($return[0]['attribs']), $this->get_base($return[0]));
+ return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0]));
}
elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights'))
{
}
}
+ /**
+ * Get the posting date/time for the item
+ *
+ * Uses `<atom:published>`, `<atom:updated>`, `<atom:issued>`,
+ * `<atom:modified>`, `<pubDate>` or `<dc:date>`
+ *
+ * Note: obeys PHP's timezone setting. To get a UTC date/time, use
+ * {@see get_gmdate}
+ *
+ * @since Beta 2 (previously called `get_item_date` since 0.8)
+ *
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
+ * @return int|string|null
+ */
public function get_date($date_format = 'j F Y, g:i a')
{
if (!isset($this->data['date']))
if (!empty($this->data['date']['raw']))
{
- $parser = SimplePie_Parse_Date::get();
+ $parser = $this->registry->call('Parse_Date', 'get');
$this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']);
}
else
}
}
+ /**
+ * Get the update date/time for the item
+ *
+ * Uses `<atom:updated>`
+ *
+ * Note: obeys PHP's timezone setting. To get a UTC date/time, use
+ * {@see get_gmdate}
+ *
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
+ * @return int|string|null
+ */
+ public function get_updated_date($date_format = 'j F Y, g:i a')
+ {
+ if (!isset($this->data['updated']))
+ {
+ if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
+ {
+ $this->data['updated']['raw'] = $return[0]['data'];
+ }
+
+ if (!empty($this->data['updated']['raw']))
+ {
+ $parser = $this->registry->call('Parse_Date', 'get');
+ $this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']);
+ }
+ else
+ {
+ $this->data['updated'] = null;
+ }
+ }
+ if ($this->data['updated'])
+ {
+ $date_format = (string) $date_format;
+ switch ($date_format)
+ {
+ case '':
+ return $this->sanitize($this->data['updated']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
+
+ case 'U':
+ return $this->data['updated']['parsed'];
+
+ default:
+ return date($date_format, $this->data['updated']['parsed']);
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Get the localized posting date/time for the item
+ *
+ * Returns the date formatted in the localized language. To display in
+ * languages other than the server's default, you need to change the locale
+ * with {@link http://php.net/setlocale setlocale()}. The available
+ * localizations depend on which ones are installed on your web server.
+ *
+ * @since 1.0
+ *
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
+ * @return int|string|null
+ */
public function get_local_date($date_format = '%c')
{
if (!$date_format)
}
}
+ /**
+ * Get the posting date/time for the item (UTC time)
+ *
+ * @see get_date
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
+ * @return int|string|null
+ */
+ public function get_gmdate($date_format = 'j F Y, g:i a')
+ {
+ $date = $this->get_date('U');
+ if ($date === null)
+ {
+ return null;
+ }
+
+ return gmdate($date_format, $date);
+ }
+
+ /**
+ * Get the update date/time for the item (UTC time)
+ *
+ * @see get_updated_date
+ * @param string $date_format Supports any PHP date format from {@see http://php.net/date}
+ * @return int|string|null
+ */
+ public function get_updated_gmdate($date_format = 'j F Y, g:i a')
+ {
+ $date = $this->get_updated_date('U');
+ if ($date === null)
+ {
+ return null;
+ }
+
+ return gmdate($date_format, $date);
+ }
+
+ /**
+ * Get the permalink for the item
+ *
+ * Returns the first link available with a relationship of "alternate".
+ * Identical to {@see get_link()} with key 0
+ *
+ * @see get_link
+ * @since 0.8
+ * @return string|null Permalink URL
+ */
public function get_permalink()
{
$link = $this->get_link();
}
}
+ /**
+ * Get a single link for the item
+ *
+ * @since Beta 3
+ * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1
+ * @param string $rel The relationship of the link to return
+ * @return string|null Link URL
+ */
public function get_link($key = 0, $rel = 'alternate')
{
$links = $this->get_links($rel);
}
}
+ /**
+ * Get all links for the item
+ *
+ * Uses `<atom:link>`, `<link>` or `<guid>`
+ *
+ * @since Beta 2
+ * @param string $rel The relationship of links to return
+ * @return array|null Links found for the item (strings)
+ */
public function get_links($rel = 'alternate')
{
if (!isset($this->data['links']))
$keys = array_keys($this->data['links']);
foreach ($keys as $key)
{
- if (SimplePie_Misc::is_isegment_nz_nc($key))
+ if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
{
if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
{
}
/**
+ * Get an enclosure from the item
+ *
+ * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS.
+ *
+ * @since Beta 2
* @todo Add ability to prefer one type of content over another (in a media group).
+ * @param int $key The enclosure that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Enclosure|null
*/
public function get_enclosure($key = 0, $prefer = null)
{
}
/**
- * Grabs all available enclosures (podcasts, etc.)
+ * Get all available enclosures (podcasts, etc.)
*
* Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS.
*
- * At this point, we're pretty much assuming that all enclosures for an item are the same content. Anything else is too complicated to properly support.
+ * At this point, we're pretty much assuming that all enclosures for an item
+ * are the same content. Anything else is too complicated to
+ * properly support.
*
+ * @since Beta 2
* @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4).
* @todo If an element exists at a level, but it's value is empty, we should fall back to the value from the parent (if it exists).
+ * @return array|null List of SimplePie_Enclosure items
*/
public function get_enclosures()
{
{
$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $captions_parent[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
+ $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
}
}
elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text'))
{
$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $captions_parent[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
+ $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
}
}
if (is_array($captions_parent))
{
- $captions_parent = array_values(SimplePie_Misc::array_unique($captions_parent));
+ $captions_parent = array_values(array_unique($captions_parent));
}
// CATEGORIES
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories_parent[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
}
foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'category') as $category)
{
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories_parent[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
}
foreach ((array) $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'category') as $category)
{
{
$label = $this->sanitize($category['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories_parent[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
if (isset($category['child'][SIMPLEPIE_NAMESPACE_ITUNES]['category']))
{
{
$label = $this->sanitize($subcategory['attribs']['']['text'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories_parent[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories_parent[] = $this->registry->create('Category', array($term, $scheme, $label));
}
}
}
if (is_array($categories_parent))
{
- $categories_parent = array_values(SimplePie_Misc::array_unique($categories_parent));
+ $categories_parent = array_values(array_unique($categories_parent));
}
// COPYRIGHT
{
$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $copyrights_parent = new $this->feed->copyright_class($copyright_url, $copyright_label);
+ $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
}
elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright'))
{
{
$copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $copyrights_parent = new $this->feed->copyright_class($copyright_url, $copyright_label);
+ $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
}
// CREDITS
{
$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $credits_parent[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
+ $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
}
}
elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit'))
{
$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $credits_parent[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
+ $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
}
}
if (is_array($credits_parent))
{
- $credits_parent = array_values(SimplePie_Misc::array_unique($credits_parent));
+ $credits_parent = array_values(array_unique($credits_parent));
}
// DESCRIPTION
}
if (is_array($hashes_parent))
{
- $hashes_parent = array_values(SimplePie_Misc::array_unique($hashes_parent));
+ $hashes_parent = array_values(array_unique($hashes_parent));
}
// KEYWORDS
}
if (is_array($keywords_parent))
{
- $keywords_parent = array_values(SimplePie_Misc::array_unique($keywords_parent));
+ $keywords_parent = array_values(array_unique($keywords_parent));
}
// PLAYER
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
}
elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
}
elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating'))
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
}
elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit'))
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings_parent[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
}
if (is_array($ratings_parent))
{
- $ratings_parent = array_values(SimplePie_Misc::array_unique($ratings_parent));
+ $ratings_parent = array_values(array_unique($ratings_parent));
}
// RESTRICTIONS
{
$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
}
elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
{
$restriction_relationship = 'deny';
}
- $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
}
elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction'))
{
$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
}
elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block'))
{
$restriction_relationship = 'deny';
}
- $restrictions_parent[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
}
if (is_array($restrictions_parent))
{
- $restrictions_parent = array_values(SimplePie_Misc::array_unique($restrictions_parent));
+ $restrictions_parent = array_values(array_unique($restrictions_parent));
+ }
+ else
+ {
+ $restrictions_parent = array(new SimplePie_Restriction('allow', null, 'default'));
}
// THUMBNAILS
{
$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
+ $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
}
if (is_array($captions))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = array_values(array_unique($captions));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text']))
{
$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
+ $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
}
if (is_array($captions))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = array_values(array_unique($captions));
}
}
else
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
}
}
if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['category']))
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
}
}
if (is_array($categories) && is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));
+ $categories = array_values(array_unique(array_merge($categories, $categories_parent)));
}
elseif (is_array($categories))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories));
+ $categories = array_values(array_unique($categories));
}
elseif (is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories_parent));
+ $categories = array_values(array_unique($categories_parent));
}
// COPYRIGHTS
{
$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
+ $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright']))
{
{
$copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
+ $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
}
else
{
{
$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
+ $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
}
if (is_array($credits))
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $credits = array_values(array_unique($credits));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit']))
{
$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
+ $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
}
if (is_array($credits))
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $credits = array_values(array_unique($credits));
}
}
else
}
if (is_array($hashes))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $hashes = array_values(array_unique($hashes));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash']))
}
if (is_array($hashes))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $hashes = array_values(array_unique($hashes));
}
}
else
}
if (is_array($keywords))
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $keywords = array_values(array_unique($keywords));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords']))
}
if (is_array($keywords))
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $keywords = array_values(array_unique($keywords));
}
}
else
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
if (is_array($ratings))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $ratings = array_values(array_unique($ratings));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating']))
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
if (is_array($ratings))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $ratings = array_values(array_unique($ratings));
}
}
else
{
$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
if (is_array($restrictions))
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $restrictions = array_values(array_unique($restrictions));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction']))
{
$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
if (is_array($restrictions))
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $restrictions = array_values(array_unique($restrictions));
}
}
else
}
if (is_array($thumbnails))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $thumbnails = array_values(array_unique($thumbnails));
}
}
elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail']))
}
if (is_array($thumbnails))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $thumbnails = array_values(array_unique($thumbnails));
}
}
else
$title = $title_parent;
}
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width);
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
}
}
}
{
$caption_text = $this->sanitize($caption['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $captions[] = new $this->feed->caption_class($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text);
+ $captions[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text));
}
if (is_array($captions))
{
- $captions = array_values(SimplePie_Misc::array_unique($captions));
+ $captions = array_values(array_unique($captions));
}
}
else
{
$label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $categories[] = new $this->feed->category_class($term, $scheme, $label);
+ $categories[] = $this->registry->create('Category', array($term, $scheme, $label));
}
}
if (is_array($categories) && is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique(array_merge($categories, $categories_parent)));
+ $categories = array_values(array_unique(array_merge($categories, $categories_parent)));
}
elseif (is_array($categories))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories));
+ $categories = array_values(array_unique($categories));
}
elseif (is_array($categories_parent))
{
- $categories = array_values(SimplePie_Misc::array_unique($categories_parent));
+ $categories = array_values(array_unique($categories_parent));
}
else
{
{
$copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $copyrights = new $this->feed->copyright_class($copyright_url, $copyright_label);
+ $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label));
}
else
{
{
$credit_name = $this->sanitize($credit['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $credits[] = new $this->feed->credit_class($credit_role, $credit_scheme, $credit_name);
+ $credits[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name));
}
if (is_array($credits))
{
- $credits = array_values(SimplePie_Misc::array_unique($credits));
+ $credits = array_values(array_unique($credits));
}
}
else
}
if (is_array($hashes))
{
- $hashes = array_values(SimplePie_Misc::array_unique($hashes));
+ $hashes = array_values(array_unique($hashes));
}
}
else
}
if (is_array($keywords))
{
- $keywords = array_values(SimplePie_Misc::array_unique($keywords));
+ $keywords = array_values(array_unique($keywords));
}
}
else
{
$rating_value = $this->sanitize($rating['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $ratings[] = new $this->feed->rating_class($rating_scheme, $rating_value);
+ $ratings[] = $this->registry->create('Rating', array($rating_scheme, $rating_value));
}
if (is_array($ratings))
{
- $ratings = array_values(SimplePie_Misc::array_unique($ratings));
+ $ratings = array_values(array_unique($ratings));
}
}
else
{
$restriction_value = $this->sanitize($restriction['data'], SIMPLEPIE_CONSTRUCT_TEXT);
}
- $restrictions[] = new $this->feed->restriction_class($restriction_relationship, $restriction_type, $restriction_value);
+ $restrictions[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value));
}
if (is_array($restrictions))
{
- $restrictions = array_values(SimplePie_Misc::array_unique($restrictions));
+ $restrictions = array_values(array_unique($restrictions));
}
}
else
}
if (is_array($thumbnails))
{
- $thumbnails = array_values(SimplePie_Misc::array_unique($thumbnails));
+ $thumbnails = array_values(array_unique($thumbnails));
}
}
else
$title = $title_parent;
}
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width);
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width));
}
}
}
}
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
}
}
}
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
}
}
}
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
}
}
if (sizeof($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $restrictions_parent || $samplingrate || $thumbnails_parent || $title_parent || $width))
{
// Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor
- $this->data['enclosures'][] = new $this->feed->enclosure_class($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width);
+ $this->data['enclosures'][] = $this->registry->create('Enclosure', array($url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width));
}
- $this->data['enclosures'] = array_values(SimplePie_Misc::array_unique($this->data['enclosures']));
+ $this->data['enclosures'] = array_values(array_unique($this->data['enclosures']));
}
if (!empty($this->data['enclosures']))
{
}
}
+ /**
+ * Get the latitude coordinates for the item
+ *
+ * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
+ *
+ * Uses `<geo:lat>` or `<georss:point>`
+ *
+ * @since 1.0
+ * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
+ * @link http://www.georss.org/ GeoRSS
+ * @return string|null
+ */
public function get_latitude()
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat'))
}
}
+ /**
+ * Get the longitude coordinates for the item
+ *
+ * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
+ *
+ * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>`
+ *
+ * @since 1.0
+ * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo
+ * @link http://www.georss.org/ GeoRSS
+ * @return string|null
+ */
public function get_longitude()
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long'))
}
}
+ /**
+ * Get the `<atom:source>` for the item
+ *
+ * @since 1.1
+ * @return SimplePie_Source|null
+ */
public function get_source()
{
if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source'))
{
- return new $this->feed->source_class($this, $return[0]);
+ return $this->registry->create('Source', array($this, $return[0]));
}
else
{