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.
\SimplePieParent feed
arrayRaw data
__destruct()
__toString() : string
stringget_base(array $element = array()) : string
Uses <xml:base>
array
stringget_categories() : array | null
Uses <atom:category>, <category> or <dc:subject>
| since | Beta 3 |
|---|
arraynullList of {@see SimplePie_Category} objectsget_category(integer $key = 0) : \SimplePie_Category | null
| since | Beta 3 (previously called `get_categories()` since Beta 2) |
|---|
integerThe category that you want to return. Remember that arrays begin with 0, not 1
\SimplePie_Categorynull
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 |
|---|
booleanShould we avoid falling back to the description?
stringnull
get_contributor(integer $key = 0) : \SimplePie_Author | null
| since | 1.1 |
|---|
integerThe contrbutor that you want to return. Remember that arrays begin with 0, not 1
\SimplePie_Authornull
get_contributors() : array | null
Uses <atom:contributor>
| since | 1.1 |
|---|
arraynullList of {@see SimplePie_Author} objectsget_copyright() : string
Uses <atom:rights> or <dc:rights>
| since | 1.1 |
|---|
stringget_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) |
|---|
stringSupports any PHP date format from {@see http://php.net/date} (empty for the raw data)
integerstringnull
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 |
|---|
booleanShould we avoid falling back to the content?
stringnull
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). |
integerThe enclosure that you want to return. Remember that arrays begin with 0, not 1
\SimplePie_Enclosurenull
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). |
arraynullList 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 |
\SimplePieget_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 |
|---|
booleanShould we force using a hash instead of the supplied ID?
stringget_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 |
stringnull
get_link(integer $key= 0, string $rel= 'alternate') : string | null
| since | Beta 3 |
|---|
integerThe link that you want to return. Remember that arrays begin with 0, not 1
stringThe relationship of the link to return
stringnullLink URLget_links(string $rel = 'alternate') : array | null
Uses <atom:link>, <link> or <guid>
| since | Beta 2 |
|---|
stringThe relationship of links to return
arraynullLinks 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 |
|---|
stringSupports any PHP date format from {@see http://php.net/strftime} (empty for the raw data)
integerstringnull
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 |
stringnull
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 |
stringnullPermalink URLget_source() : \SimplePie_Source | null
| since | 1.1 |
|---|
\SimplePie_Sourcenull
get_title() : string | null
Uses <atom:title>, <title> or <dc:title>
| since | Beta 2 (previously called `get_item_title` since 0.8) |
|---|
stringnull
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
stringSupports any PHP date format from {@see http://php.net/date} (empty for the raw data)
integerstringnull
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 |
|---|