foreach( $this->revisions as $revid ) {
$where[] = intval($revid);
}
- $whereClause = 'rev_id IN(' . implode(',',$where) . ')';
$result = $dbr->select( array('revision','page'), '*',
- array( 'rev_page' => $this->page->getArticleID(),
- $whereClause, 'rev_page = page_id' ),
+ array(
+ 'rev_page' => $this->page->getArticleID(),
+ 'rev_id' => $where,
+ 'rev_page = page_id' ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
$revObjs[$row->rev_id] = new Revision( $row );
foreach( $this->archrevs as $timestamp ) {
$where[] = $dbr->addQuotes( $timestamp );
}
- $whereClause = 'ar_timestamp IN(' . implode(',',$where) . ')';
$result = $dbr->select( 'archive', '*',
- array( 'ar_namespace' => $this->page->getNamespace(),
+ array(
+ 'ar_namespace' => $this->page->getNamespace(),
'ar_title' => $this->page->getDBKey(),
- $whereClause ),
+ 'ar_timestamp' => $where ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
$revObjs[$row->ar_timestamp] = new Revision( array(
foreach( $this->ofiles as $timestamp ) {
$where[] = $dbr->addQuotes( $timestamp.'!'.$this->page->getDBKey() );
}
- $whereClause = 'oi_archive_name IN(' . implode(',',$where) . ')';
$result = $dbr->select( 'oldimage', '*',
- array( 'oi_name' => $this->page->getDBKey(),
- $whereClause ),
+ array(
+ 'oi_name' => $this->page->getDBKey(),
+ 'oi_archive_name' => $where ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
$filesObjs[$row->oi_archive_name] = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
foreach( $this->afiles as $id ) {
$where[] = intval($id);
}
- $whereClause = 'fa_id IN(' . implode(',',$where) . ')';
$result = $dbr->select( 'filearchive', '*',
- array( 'fa_name' => $this->page->getDBKey(),
- $whereClause ),
+ array(
+ 'fa_name' => $this->page->getDBKey(),
+ 'fa_id' => $where ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
$filesObjs[$row->fa_id] = ArchivedFile::newFromRow( $row );
$where[] = intval($logid);
}
list($log,$logtype) = explode( '/',$this->page->getDBKey(), 2 );
- $whereClause = "log_type = '$logtype' AND log_id IN(" . implode(',',$where) . ")";
$result = $dbr->select( 'logging', '*',
- array( $whereClause ),
+ array(
+ 'log_type' => $logtype,
+ 'log_id' => $where ),
__METHOD__ );
while( $row = $dbr->fetchObject( $result ) ) {
$logRows[$row->log_id] = $row;
foreach( $items as $revid ) {
$where[] = intval($revid);
}
- $whereClause = 'rev_id IN(' . implode(',',$where) . ')';
$result = $this->dbw->select( 'revision', '*',
- array( 'rev_page' => $title->getArticleID(),
- $whereClause ),
+ array(
+ 'rev_page' => $title->getArticleID(),
+ 'rev_id' => $where ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {
$revObjs[$row->rev_id] = new Revision( $row );
foreach( $items as $timestamp ) {
$where[] = $this->dbw->addQuotes( $timestamp );
}
- $whereClause = 'ar_timestamp IN(' . implode(',',$where) . ')';
$result = $this->dbw->select( 'archive', '*',
- array( 'ar_namespace' => $title->getNamespace(),
+ array(
+ 'ar_namespace' => $title->getNamespace(),
'ar_title' => $title->getDBKey(),
- $whereClause ),
+ 'ar_timestamp' => $where ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {
$revObjs[$row->ar_timestamp] = new Revision( array(
foreach( $items as $timestamp ) {
$where[] = $this->dbw->addQuotes( $timestamp.'!'.$title->getDBKey() );
}
- $whereClause = 'oi_archive_name IN(' . implode(',',$where) . ')';
$result = $this->dbw->select( 'oldimage', '*',
- array( 'oi_name' => $title->getDBKey(),
- $whereClause ),
+ array(
+ 'oi_name' => $title->getDBKey(),
+ 'oi_archive_name' => $where ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {
$filesObjs[$row->oi_archive_name] = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
foreach( $items as $id ) {
$where[] = intval($id);
}
- $whereClause = 'fa_id IN(' . implode(',',$where) . ')';
$result = $this->dbw->select( 'filearchive', '*',
array( 'fa_name' => $title->getDBKey(),
- $whereClause ),
+ 'fa_id' => $where ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {
$filesObjs[$row->fa_id] = ArchivedFile::newFromRow( $row );
$where[] = intval($logid);
}
list($log,$logtype) = explode( '/',$title->getDBKey(), 2 );
- $whereClause = "log_type ='$logtype' AND log_id IN(" . implode(',',$where) . ")";
$result = $this->dbw->select( 'logging', '*',
- array( $whereClause ),
+ array(
+ 'log_type' => $logtype,
+ 'log_id' => $where ),
__METHOD__ );
while( $row = $this->dbw->fetchObject( $result ) ) {
$logRows[$row->log_id] = $row;