本文整理汇总了PHP中RecentChange::setAttribs方法的典型用法代码示例。如果您正苦于以下问题:PHP RecentChange::setAttribs方法的具体用法?PHP RecentChange::setAttribs怎么用?PHP RecentChange::setAttribs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecentChange
的用法示例。
在下文中一共展示了RecentChange::setAttribs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertParseParams
/**
* @param array $expectedParseParams
* @param string|null $rawRcParams
*/
protected function assertParseParams($expectedParseParams, $rawRcParams)
{
$rc = new RecentChange();
$rc->setAttribs(['rc_params' => $rawRcParams]);
$actualParseParams = $rc->parseParams();
$this->assertEquals($expectedParseParams, $actualParseParams);
}
示例2: makeRecentChange
private function makeRecentChange($attribs, $counter, $watchingUsers)
{
$change = new RecentChange();
$change->setAttribs($attribs);
$change->counter = $counter;
$change->numberofWatchingusers = $watchingUsers;
return $change;
}
示例3: watchlistNotify
/**
* Hook
*
* @param RecentChange $oRC -- instance of RecentChange class
*
* @static
* @access public
*
* @return Bool true -- because it's a hook
*/
public static function watchlistNotify(RecentChange &$oRC)
{
global $wgEnableGroupedArticleCommentsRC;
wfProfileIn(__METHOD__);
wfRunHooks('AC_RecentChange_Save', array(&$oRC));
if (!empty($wgEnableGroupedArticleCommentsRC) && $oRC instanceof RecentChange) {
$title = $oRC->getAttribute('rc_title');
$namespace = $oRC->getAttribute('rc_namespace');
$article_id = $oRC->getAttribute('rc_cur_id');
$title = Title::newFromText($title, $namespace);
//TODO: review
if (MWNamespace::isTalk($namespace) && ArticleComment::isTitleComment($title) && !empty($article_id)) {
$comment = ArticleComment::newFromId($article_id);
if ($comment instanceof ArticleComment) {
$oArticlePage = $comment->getArticleTitle();
$mAttribs = $oRC->mAttribs;
$mAttribs['rc_title'] = $oArticlePage->getDBkey();
$mAttribs['rc_namespace'] = $oArticlePage->getNamespace();
$mAttribs['rc_log_action'] = 'article_comment';
$oRC->setAttribs($mAttribs);
}
}
}
wfProfileOut(__METHOD__);
return true;
}