本文整理汇总了PHP中Revision::pageJoinCond方法的典型用法代码示例。如果您正苦于以下问题:PHP Revision::pageJoinCond方法的具体用法?PHP Revision::pageJoinCond怎么用?PHP Revision::pageJoinCond使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Revision
的用法示例。
在下文中一共展示了Revision::pageJoinCond方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doQuery
/**
* @param IDatabase $db
* @return mixed
*/
public function doQuery($db)
{
$ids = array_map('intval', $this->ids);
$queryInfo = array('tables' => array('revision', 'user'), 'fields' => array_merge(Revision::selectFields(), Revision::selectUserFields()), 'conds' => array('rev_page' => $this->title->getArticleID(), 'rev_id' => $ids), 'options' => array('ORDER BY' => 'rev_id DESC'), 'join_conds' => array('page' => Revision::pageJoinCond(), 'user' => Revision::userJoinCond()));
ChangeTags::modifyDisplayQuery($queryInfo['tables'], $queryInfo['fields'], $queryInfo['conds'], $queryInfo['join_conds'], $queryInfo['options'], '');
return $db->select($queryInfo['tables'], $queryInfo['fields'], $queryInfo['conds'], __METHOD__, $queryInfo['options'], $queryInfo['join_conds']);
}
示例2: doQuery
/**
* @param $db DatabaseBase
* @return mixed
*/
public function doQuery($db)
{
$ids = array_map('intval', $this->ids);
$live = $db->select(array('revision', 'page', 'user'), array_merge(Revision::selectFields(), Revision::selectUserFields()), array('rev_page' => $this->title->getArticleID(), 'rev_id' => $ids), __METHOD__, array('ORDER BY' => 'rev_id DESC'), array('page' => Revision::pageJoinCond(), 'user' => Revision::userJoinCond()));
if ($live->numRows() >= count($ids)) {
// All requested revisions are live, keeps things simple!
return $live;
}
// Check if any requested revisions are available fully deleted.
$archived = $db->select(array('archive'), '*', array('ar_rev_id' => $ids), __METHOD__, array('ORDER BY' => 'ar_rev_id DESC'));
if ($archived->numRows() == 0) {
return $live;
} elseif ($live->numRows() == 0) {
return $archived;
} else {
// Combine the two! Whee
$rows = array();
foreach ($live as $row) {
$rows[$row->rev_id] = $row;
}
foreach ($archived as $row) {
$rows[$row->ar_rev_id] = $row;
}
krsort($rows);
return new FakeResultWrapper(array_values($rows));
}
}
示例3: doQuery
/**
* @param IDatabase $db
* @return mixed
*/
public function doQuery($db)
{
$ids = array_map('intval', $this->ids);
$queryInfo = ['tables' => ['revision', 'user'], 'fields' => array_merge(Revision::selectFields(), Revision::selectUserFields()), 'conds' => ['rev_page' => $this->title->getArticleID(), 'rev_id' => $ids], 'options' => ['ORDER BY' => 'rev_id DESC'], 'join_conds' => ['page' => Revision::pageJoinCond(), 'user' => Revision::userJoinCond()]];
ChangeTags::modifyDisplayQuery($queryInfo['tables'], $queryInfo['fields'], $queryInfo['conds'], $queryInfo['join_conds'], $queryInfo['options'], '');
$live = $db->select($queryInfo['tables'], $queryInfo['fields'], $queryInfo['conds'], __METHOD__, $queryInfo['options'], $queryInfo['join_conds']);
if ($live->numRows() >= count($ids)) {
// All requested revisions are live, keeps things simple!
return $live;
}
$archiveQueryInfo = ['tables' => ['archive'], 'fields' => Revision::selectArchiveFields(), 'conds' => ['ar_rev_id' => $ids], 'options' => ['ORDER BY' => 'ar_rev_id DESC'], 'join_conds' => []];
ChangeTags::modifyDisplayQuery($archiveQueryInfo['tables'], $archiveQueryInfo['fields'], $archiveQueryInfo['conds'], $archiveQueryInfo['join_conds'], $archiveQueryInfo['options'], '');
// Check if any requested revisions are available fully deleted.
$archived = $db->select($archiveQueryInfo['tables'], $archiveQueryInfo['fields'], $archiveQueryInfo['conds'], __METHOD__, $archiveQueryInfo['options'], $archiveQueryInfo['join_conds']);
if ($archived->numRows() == 0) {
return $live;
} elseif ($live->numRows() == 0) {
return $archived;
} else {
// Combine the two! Whee
$rows = [];
foreach ($live as $row) {
$rows[$row->rev_id] = $row;
}
foreach ($archived as $row) {
$rows[$row->ar_rev_id] = $row;
}
krsort($rows);
return new FakeResultWrapper(array_values($rows));
}
}
示例4: getQueryInfo
function getQueryInfo()
{
$conds = $this->mConds;
$conds['rev_page'] = $this->articleID;
$conds[] = "rev_timestamp < " . $this->mDb->addQuotes($this->maxTimestamp);
return ['tables' => ['revision', 'page', 'user'], 'fields' => array_merge(Revision::selectFields(), Revision::selectUserFields()), 'conds' => $conds, 'join_conds' => ['page' => Revision::pageJoinCond(), 'user' => Revision::userJoinCond()]];
}
示例5: doQuery
/**
* @param IDatabase $db
* @return mixed
*/
public function doQuery($db)
{
$conds = ['rev_page' => $this->title->getArticleID()];
if ($this->ids !== null) {
$conds['rev_id'] = array_map('intval', $this->ids);
}
return $db->select(['revision', 'page', 'user'], array_merge(Revision::selectFields(), Revision::selectUserFields()), $conds, __METHOD__, ['ORDER BY' => 'rev_id DESC'], ['page' => Revision::pageJoinCond(), 'user' => Revision::userJoinCond()]);
}
示例6: getQueryInfo
function getQueryInfo()
{
list($tables, $index, $userCond, $join_cond) = $this->getUserCond();
$user = $this->getUser();
$conds = array_merge($userCond, $this->getNamespaceCond());
// Paranoia: avoid brute force searches (bug 17342)
if (!$user->isAllowed('deletedhistory')) {
$conds[] = $this->mDb->bitAnd('rev_deleted', Revision::DELETED_USER) . ' = 0';
} elseif (!$user->isAllowed('suppressrevision')) {
$conds[] = $this->mDb->bitAnd('rev_deleted', Revision::SUPPRESSED_USER) . ' != ' . Revision::SUPPRESSED_USER;
}
# Don't include orphaned revisions
$join_cond['page'] = Revision::pageJoinCond();
# Get the current user name for accounts
$join_cond['user'] = Revision::userJoinCond();
$queryInfo = array('tables' => $tables, 'fields' => array_merge(Revision::selectFields(), Revision::selectUserFields(), array('page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect', 'page_len')), 'conds' => $conds, 'options' => array('USE INDEX' => array('revision' => $index)), 'join_conds' => $join_cond);
ChangeTags::modifyDisplayQuery($queryInfo['tables'], $queryInfo['fields'], $queryInfo['conds'], $queryInfo['join_conds'], $queryInfo['options'], $this->tagFilter);
wfRunHooks('ContribsPager::getQueryInfo', array(&$this, &$queryInfo));
return $queryInfo;
}
示例7: getQueryInfo
function getQueryInfo() {
$conds = $this->mConds;
$conds['rev_page'] = $this->articleID;
$conds[] = "rev_timestamp < {$this->maxTimestamp}";
return array(
'tables' => array( 'revision', 'page', 'user' ),
'fields' => array_merge( Revision::selectFields(), Revision::selectUserFields() ),
'conds' => $conds,
'join_conds' => array(
'page' => Revision::pageJoinCond(),
'user' => Revision::userJoinCond() )
);
}