Manages all item-related data
Used by \SimplePie::get_item() and \SimplePie::get_items()
This class can be overloaded with \SimplePie::set_item_class()
package | SimplePie |
---|---|
subpackage | API |
__construct(\SimplePie $feed, array $data)
This is usually used by \SimplePie::get_items and \SimplePie::get_item. Avoid creating this manually.
\SimplePie
Parent feed
array
Raw data
__destruct()
__toString() : string
string
get_base(array $element = array()
) : string
Uses <xml:base>
array
string
get_categories() : array | null
Uses <atom:category>
, <category>
or <dc:subject>
since | Beta 3 |
---|
array
null
List of {@see SimplePie_Category} objectsget_category(integer $key = 0
) : \SimplePie_Category | null
since | Beta 3 (previously called `get_categories()` since Beta 2) |
---|
integer
The category that you want to return. Remember that arrays begin with 0, not 1
\SimplePie_Category
null
get_content(boolean $content_only = false
) : string | null
Prefers full content over summaries, but will return a summary if full content does not exist.
To prefer summaries instead, use \get_description
Uses <atom:content>
or <content:encoded>
(RSS 1.0 Content Module)
since | 1.0 |
---|
boolean
Should we avoid falling back to the description?
string
null
get_contributor(integer $key = 0
) : \SimplePie_Author | null
since | 1.1 |
---|
integer
The contrbutor that you want to return. Remember that arrays begin with 0, not 1
\SimplePie_Author
null
get_contributors() : array | null
Uses <atom:contributor>
since | 1.1 |
---|
array
null
List of {@see SimplePie_Author} objectsget_copyright() : string
Uses <atom:rights>
or <dc:rights>
since | 1.1 |
---|
string
get_date(string $date_format = 'j F Y, g:i a'
) : integer | string | null
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 \get_gmdate
since | Beta 2 (previously called `get_item_date` since 0.8) |
---|
string
Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
integer
string
null
get_description(boolean $description_only = false
) : string | null
Prefers summaries over full content , but will return full content if a summary does not exist.
To prefer full content instead, use \get_content
Uses <atom:summary>
, <description>
, <dc:description>
or
<itunes:subtitle>
since | 0.8 |
---|
boolean
Should we avoid falling back to the content?
string
null
get_enclosure(integer $key= 0
, $prefer= null
) : \SimplePie_Enclosure | null
Supports the
since | Beta 2 |
---|---|
todo | Add ability to prefer one type of content over another (in a media group). |
integer
The enclosure that you want to return. Remember that arrays begin with 0, not 1
\SimplePie_Enclosure
null
get_enclosures() : array | null
Supports the
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). |
array
null
List of SimplePie_Enclosure itemsget_feed() : \SimplePie
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 |
\SimplePie
get_gmdate(string $date_format = 'j F Y, g:i a'
) : integer | string | null
get_id(boolean $hash = false
) : string
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 |
---|
boolean
Should we force using a hash instead of the supplied ID?
string
get_latitude() : string | null
Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
Uses <geo:lat>
or <georss:point>
since | 1.0 |
---|---|
link | W3C WGS84 Basic Geo |
link | GeoRSS |
string
null
get_link(integer $key= 0
, string $rel= 'alternate'
) : string | null
since | Beta 3 |
---|
integer
The link that you want to return. Remember that arrays begin with 0, not 1
string
The relationship of the link to return
string
null
Link URLget_links(string $rel = 'alternate'
) : array | null
Uses <atom:link>
, <link>
or <guid>
since | Beta 2 |
---|
string
The relationship of links to return
array
null
Links found for the item (strings)get_local_date(string $date_format = '%c'
) : integer | string | null
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 setlocale(). The available localizations depend on which ones are installed on your web server.
since | 1.0 |
---|
string
Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
integer
string
null
get_longitude() : string | null
Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications
Uses <geo:long>
, <geo:lon>
or <georss:point>
since | 1.0 |
---|---|
link | W3C WGS84 Basic Geo |
link | GeoRSS |
string
null
get_permalink() : string | null
Returns the first link available with a relationship of "alternate". Identical to \get_link() with key 0
see | |
---|---|
since | 0.8 |
string
null
Permalink URLget_source() : \SimplePie_Source | null
since | 1.1 |
---|
\SimplePie_Source
null
get_title() : string | null
Uses <atom:title>
, <title>
or <dc:title>
since | Beta 2 (previously called `get_item_title` since 0.8) |
---|
string
null
get_updated_date(string $date_format = 'j F Y, g:i a'
) : integer | string | null
Uses <atom:updated>
Note: obeys PHP's timezone setting. To get a UTC date/time, use \get_gmdate
string
Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
integer
string
null
get_updated_gmdate(string $date_format = 'j F Y, g:i a'
) : integer | string | null
sanitize(string $data, integer $type, string $base = ''
) : string
set_registry(\SimplePie_Registry $registry)
This is usually used by \SimplePie_Registry::create
since | 1.3 |
---|
\SimplePie_Registry
$data : array
array()
access | private |
---|
$feed : \SimplePie
access | private |
---|