本文整理匯總了PHP中ResultWrapper::key方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResultWrapper::key方法的具體用法?PHP ResultWrapper::key怎麽用?PHP ResultWrapper::key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ResultWrapper
的用法示例。
在下文中一共展示了ResultWrapper::key方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showContributions
/**
* Render the contributions of user to page
* @param ResultWrapper $res
*/
protected function showContributions(ResultWrapper $res)
{
$numRows = $res->numRows();
$rev = null;
$out = $this->getOutput();
$revs = array();
$prevRevs = array();
foreach ($res as $row) {
$rev = new Revision($row);
$revs[] = $rev;
if ($res->key() <= self::LIMIT + 1 && $rev->getParentId()) {
$prevRevs[] = $rev->getParentId();
}
}
$this->prevLengths = Revision::getParentLengths(wfGetDB(DB_SLAVE), $prevRevs);
if ($numRows > 0) {
$count = 0;
foreach ($revs as $rev) {
if ($count++ < self::LIMIT) {
$this->showContributionsRow($rev);
}
}
$out->addHtml('</ul>');
// Captured 1 more than we should have done so if the number of
// results is greater than the limit there are more to show.
if ($numRows > self::LIMIT) {
$out->addHtml($this->getMoreButton($rev->getTimestamp()));
}
} else {
// For users who exist but have not made any edits
$out->addHtml(MobileUI::warningBox($this->msg('mobile-frontend-history-no-results')));
}
}
開發者ID:micha6554,項目名稱:mediawiki-extensions-MobileFrontend,代碼行數:37,代碼來源:SpecialMobileContributions.php
示例2: key
public function key()
{
return $this->res ? $this->res->key() : 0;
}