本文整理汇总了PHP中FeedItem::getDate方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::getDate方法的具体用法?PHP FeedItem::getDate怎么用?PHP FeedItem::getDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedItem
的用法示例。
在下文中一共展示了FeedItem::getDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newFromFeedItem
/**
* Convert a FeedItem to an FeedSMItem.
* This is to make sitemap feed get along with normal MediaWiki feeds.
* @param FeedItem Original item.
* @return FeedSMItem Converted item.
*/
public static function newFromFeedItem(FeedItem $item)
{
// @todo FIXME: This is borked (esp. on history), but better than a fatal (not by much).
// maybe try and get title from url?
$title = Title::newFromText($item->getTitle());
if (!$title) {
throw new MWException('Error getting title object from string in FeedItem.');
}
$date = $item->getDate();
return new FeedSMItem($title, $date);
}
示例2: outItem
/**
* Output a given item.
* @param FeedItem $item
*/
function outItem($item)
{
global $wgMimeType;
// @codingStandardsIgnoreStart Ignore long lines and formatting issues.
?>
<entry>
<id><?php
print $item->getUniqueId();
?>
</id>
<title><?php
print $item->getTitle();
?>
</title>
<link rel="alternate" type="<?php
print $wgMimeType;
?>
" href="<?php
print wfExpandUrl($item->getUrl(), PROTO_CURRENT);
?>
"/>
<?php
if ($item->getDate()) {
?>
<updated><?php
print $this->formatTime($item->getDate());
?>
Z</updated>
<?php
}
?>
<summary type="html"><?php
print $item->getDescription();
?>
</summary>
<?php
if ($item->getAuthor()) {
?>
<author><name><?php
print $item->getAuthor();
?>
</name></author><?php
}
?>
</entry>
<?php
/* @todo FIXME: Need to add comments
<?php if( $item->getComments() ) { ?><dc:comment><?php print $item->getComments() ?></dc:comment><?php }?>
*/
}