MediaWiki master
MediaWiki\Feed\FeedItem Class Reference

A base class for outputting syndication feeds (e.g. More...

Inherited by MediaWiki\Feed\ChannelFeed.

Collaboration diagram for MediaWiki\Feed\FeedItem:

Public Member Functions

 __construct ( $title, $description, $url, $date='', $author='', $comments='')
 
 getAuthor ()
 Get the author of this item; already xml-encoded.
 
 getAuthorUnescaped ()
 Get the author of this item without any escaping.
 
 getComments ()
 Get the comment of this item; already xml-encoded.
 
 getCommentsUnescaped ()
 Get the comment of this item without any escaping.
 
 getDate ()
 Get the date of this item.
 
 getDescription ()
 Get the description of this item; already xml-encoded.
 
 getDescriptionUnescaped ()
 Get the description of this item without any escaping.
 
 getLanguage ()
 Get the language of this item.
 
 getTitle ()
 Get the title of this item; already xml-encoded.
 
 getUniqueID ()
 Get the unique id of this item; already xml-encoded.
 
 getUniqueIdUnescaped ()
 Get the unique id of this item, without any escaping.
 
 getUrl ()
 Get the URL of this item; already xml-encoded.
 
 getUrlUnescaped ()
 Get the URL of this item without any escaping.
 
 setUniqueId ( $uniqueId, $rssIsPermalink=false)
 Set the unique id of an item.
 
 xmlEncode ( $string)
 Encode $string so that it can be safely embedded in a XML document.
 

Static Public Member Functions

static stripComment ( $text)
 Quickie hack... strip out wikilinks to more legible form from the comment.
 

Public Attributes

string $author
 
string $comments
 
string $date
 
string $description
 
bool $rssIsPermalink = false
 
string $title
 
string $uniqueId
 
string $url
 

Protected Attributes

UrlUtils $urlUtils
 

Detailed Description

A base class for outputting syndication feeds (e.g.

RSS and other formats).

Definition at line 40 of file FeedItem.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Feed\FeedItem::__construct ( $title,
$description,
$url,
$date = '',
$author = '',
$comments = '' )
Parameters
string$titleItem's title
string$description
string$urlURL uniquely designating the item.
string$dateItem's date
string$authorAuthor's user name
string$comments

Reimplemented in MediaWiki\Feed\ChannelFeed.

Definition at line 75 of file FeedItem.php.

References MediaWiki\Feed\FeedItem\$author, MediaWiki\Feed\FeedItem\$comments, MediaWiki\Feed\FeedItem\$date, MediaWiki\Feed\FeedItem\$description, MediaWiki\Feed\FeedItem\$title, MediaWiki\Feed\FeedItem\$url, and MediaWiki\MediaWikiServices\getInstance().

Member Function Documentation

◆ getAuthor()

MediaWiki\Feed\FeedItem::getAuthor ( )

Get the author of this item; already xml-encoded.

Returns
string

Definition at line 207 of file FeedItem.php.

◆ getAuthorUnescaped()

MediaWiki\Feed\FeedItem::getAuthorUnescaped ( )

Get the author of this item without any escaping.

Returns
string

Definition at line 216 of file FeedItem.php.

◆ getComments()

MediaWiki\Feed\FeedItem::getComments ( )

Get the comment of this item; already xml-encoded.

Returns
string

Definition at line 225 of file FeedItem.php.

◆ getCommentsUnescaped()

MediaWiki\Feed\FeedItem::getCommentsUnescaped ( )

Get the comment of this item without any escaping.

Returns
string

Definition at line 234 of file FeedItem.php.

◆ getDate()

MediaWiki\Feed\FeedItem::getDate ( )

Get the date of this item.

Returns
string

Definition at line 198 of file FeedItem.php.

◆ getDescription()

MediaWiki\Feed\FeedItem::getDescription ( )

Get the description of this item; already xml-encoded.

Returns
string

Definition at line 169 of file FeedItem.php.

Referenced by MediaWiki\Feed\AtomFeed\outHeader(), and MediaWiki\Feed\RSSFeed\outHeader().

◆ getDescriptionUnescaped()

MediaWiki\Feed\FeedItem::getDescriptionUnescaped ( )

Get the description of this item without any escaping.

Returns
string

Definition at line 178 of file FeedItem.php.

◆ getLanguage()

MediaWiki\Feed\FeedItem::getLanguage ( )

Get the language of this item.

Returns
string

Definition at line 187 of file FeedItem.php.

References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\LanguageCode.

Referenced by MediaWiki\Feed\AtomFeed\outHeader(), and MediaWiki\Feed\RSSFeed\outHeader().

◆ getTitle()

MediaWiki\Feed\FeedItem::getTitle ( )

Get the title of this item; already xml-encoded.

Returns
string

Definition at line 143 of file FeedItem.php.

Referenced by MediaWiki\Feed\AtomFeed\outHeader(), and MediaWiki\Feed\RSSFeed\outHeader().

◆ getUniqueID()

MediaWiki\Feed\FeedItem::getUniqueID ( )

Get the unique id of this item; already xml-encoded.

Returns
string

Definition at line 107 of file FeedItem.php.

References MediaWiki\Feed\FeedItem\getUniqueIdUnescaped(), and MediaWiki\Feed\FeedItem\xmlEncode().

◆ getUniqueIdUnescaped()

MediaWiki\Feed\FeedItem::getUniqueIdUnescaped ( )

Get the unique id of this item, without any escaping.

Returns
string|null

Definition at line 119 of file FeedItem.php.

References PROTO_CURRENT.

Referenced by MediaWiki\Feed\FeedItem\getUniqueID().

◆ getUrl()

MediaWiki\Feed\FeedItem::getUrl ( )

Get the URL of this item; already xml-encoded.

Returns
string

Definition at line 152 of file FeedItem.php.

◆ getUrlUnescaped()

MediaWiki\Feed\FeedItem::getUrlUnescaped ( )

Get the URL of this item without any escaping.

Returns
string

Definition at line 160 of file FeedItem.php.

References $url.

◆ setUniqueId()

MediaWiki\Feed\FeedItem::setUniqueId ( $uniqueId,
$rssIsPermalink = false )

Set the unique id of an item.

Parameters
string$uniqueIdUnique id for the item
bool$rssIsPermalinkSet to true if the guid (unique id) is a permalink (RSS feeds only)

Definition at line 133 of file FeedItem.php.

◆ stripComment()

static MediaWiki\Feed\FeedItem::stripComment ( $text)
static

Quickie hack... strip out wikilinks to more legible form from the comment.

Parameters
string$textWikitext
Returns
string

Definition at line 245 of file FeedItem.php.

◆ xmlEncode()

MediaWiki\Feed\FeedItem::xmlEncode ( $string)

Encode $string so that it can be safely embedded in a XML document.

Parameters
string$stringString to encode
Returns
string

Definition at line 95 of file FeedItem.php.

Referenced by MediaWiki\Feed\FeedItem\getUniqueID(), MediaWiki\Feed\AtomFeed\outHeader(), MediaWiki\Feed\RSSFeed\outHeader(), MediaWiki\Feed\AtomFeed\outItem(), and MediaWiki\Feed\RSSFeed\outItem().

Member Data Documentation

◆ $author

string MediaWiki\Feed\FeedItem::$author

◆ $comments

string MediaWiki\Feed\FeedItem::$comments

◆ $date

string MediaWiki\Feed\FeedItem::$date

◆ $description

string MediaWiki\Feed\FeedItem::$description

◆ $rssIsPermalink

bool MediaWiki\Feed\FeedItem::$rssIsPermalink = false

Definition at line 63 of file FeedItem.php.

◆ $title

string MediaWiki\Feed\FeedItem::$title

◆ $uniqueId

string MediaWiki\Feed\FeedItem::$uniqueId

Definition at line 57 of file FeedItem.php.

◆ $url

string MediaWiki\Feed\FeedItem::$url

◆ $urlUtils

UrlUtils MediaWiki\Feed\FeedItem::$urlUtils
protected

Definition at line 65 of file FeedItem.php.


The documentation for this class was generated from the following file: