return true;
}
+
/**
* Insert a new empty page record for this article.
* This *must* be followed up by creating a revision
* Best if all done inside a transaction.
*
* @param IDatabase $dbw
- * @return int|bool The newly created page_id key; false if the title already existed
+ * @param int|null $pageId Custom page ID that will be used for the insert statement
+ *
+ * @return bool|int The newly created page_id key; false if the title already existed
*/
- public function insertOn( $dbw ) {
+ public function insertOn( $dbw, $pageId = null ) {
+ $pageId = $pageId ?: $dbw->nextSequenceValue( 'page_page_id_seq' );
$dbw->insert(
'page',
array(
- 'page_id' => $dbw->nextSequenceValue( 'page_page_id_seq' ),
+ 'page_id' => $pageId,
'page_namespace' => $this->mTitle->getNamespace(),
'page_title' => $this->mTitle->getDBkey(),
'page_restrictions' => '',
return Status::newFatal( "undeleterevdel" );
}
// Safe to insert now...
- $newid = $article->insertOn( $dbw );
+ $newid = $article->insertOn( $dbw, $row->ar_page_id );
$pageId = $newid;
} else {
// Check if a deleted revision will become the current revision...