// Get normal protections for existing titles
if(count($this->titles))
{
+ $this->resetQueryParams();
$this->addTables(array('page_restrictions', 'page'));
$this->addWhere('page_id=pr_page');
$this->addFields(array('pr_page', 'pr_type', 'pr_level',
}
/**
- * Get information about watched status and put it in $watched
- */
+ * Get information about watched status and put it in $watched
+ */
private function getWatchedInfo()
{
global $wgUser;
$lb = new LinkBatch($this->titles);
+ $this->resetQueryParams();
$this->addTables(array('page', 'watchlist'));
$this->addFields(array('page_title', 'page_namespace'));
- $this->addWhere($lb->constructSet('page', $db));
- $this->addWhere('wl_title=page_title');
- $this->addWhere('wl_namespace=page_namespace');
- $this->addWhereFld('wl_user', $wgUser->getID());
+ $this->addWhere(array(
+ $lb->constructSet('page', $db),
+ 'wl_namespace=page_namespace',
+ 'wl_title=page_title',
+ 'wl_user' => $wgUser->getID()
+ ));
$res = $this->select(__METHOD__);
public function getAllowedParams() {
return array (
'prop' => array (
- ApiBase :: PARAM_DFLT => NULL,
+ ApiBase :: PARAM_DFLT => null,
ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => array (
'protection',
'readable',
)),
'token' => array (
- ApiBase :: PARAM_DFLT => NULL,
+ ApiBase :: PARAM_DFLT => null,
ApiBase :: PARAM_ISMULTI => true,
ApiBase :: PARAM_TYPE => array_keys($this->getTokenFunctions())
),
'Which additional properties to get:',
' protection - List the protection level of each page',
' talkid - The page ID of the talk page for each non-talk page',
- ' watched - List the watched status of each page',
+ ' watched - List the watched status of each page',
' subjectid - The page ID of the parent page for each talk page'
),
'token' => 'Request a token to perform a data-modifying action on a page',