本文整理匯總了PHP中FeedItem::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP FeedItem::__construct方法的具體用法?PHP FeedItem::__construct怎麽用?PHP FeedItem::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FeedItem
的用法示例。
在下文中一共展示了FeedItem::__construct方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param Title $title Title object that this entry is for.
* @param String $pubDate Publish date formattable by wfTimestamp.
* @param Array $keywords list of (String) keywords
* @param Mixed Boolean or Integer. Namespace containing comments page for entry.
* True for the corresponding talk page of $title
* False for none
* An integer for the page name of $title in the specific namespace denoted by that integer.
*/
public function __construct($title, $pubDate, $keywords = '', $comment = true)
{
if (!$title || !$title instanceof Title) {
// Paranoia
throw new MWException('Invalid title object passed to FeedSMItem');
}
$commentsURL = '';
if ($comment === true) {
// The comment ns is this article's talk namespace.
$commentsURL = $title->getTalkPage()->getFullUrl();
} elseif (is_int($comment)) {
// There's a specific comments namespace.
$commentsTitle = Title::makeTitle($comment, $title->getDBkey());
if ($commentsTitle) {
$commentsURL = $commentsTitle->getFullUrl();
}
}
$this->keywords = $keywords;
$this->titleObj = $title;
parent::__construct($title->getText(), '', $title->getFullURL(), $pubDate, '', $commentsURL);
}
示例2: FeedItem
function __construct($version = RSS2)
{
parent::__construct($version);
$this->version = $version;
$this->feeditem = new FeedItem($version);
// Setting default value for essential channel elements
$this->channels['title'] = $version . ' Feed';
$this->channels['link'] = 'http://www.sorewarding.com';
//Tag names to encode in CDATA
$this->CDATAEncoding = array('description', 'content:encoded', 'summary');
}
示例3: __construct
public function __construct($title, $url, $text, $date)
{
parent::__construct($title, $text, $url, $date);
}
示例4: array
function __construct($title, $description, $url, $date = '', $author = '', $comments = '', $OtherTags = false)
{
parent::__construct($title, $description, $url, $date, $author, $comments);
$this->OtherTags = !empty($OtherTags) ? $OtherTags : array();
}