/**
* Return the list of revision fields that should be selected to create
* a new revision.
+ * @return array
*/
public static function selectFields() {
return array(
/**
* Return the list of text fields that should be selected to read the
* revision text
+ * @return array
*/
public static function selectTextFields() {
return array(
/**
* Return the list of page fields that should be selected from page table
+ * @return array
*/
public static function selectPageFields() {
return array(
/**
* Return the list of user fields that should be selected from user table
+ * @return array
*/
public static function selectUserFields() {
return array( 'user_name' );
/**
* Get parent revision ID (the original previous page revision)
*
- * @return Integer
+ * @return Integer|null
*/
public function getParentId() {
return $this->mParentId;
$dbr = wfGetDB( DB_SLAVE );
$row = $dbr->selectRow(
array( 'page', 'revision' ),
- array( 'page_namespace', 'page_title' ),
+ self::selectPageFields(),
array( 'page_id=rev_page',
'rev_id' => $this->mId ),
- 'Revision::getTitle' );
- if( $row ) {
- $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
+ __METHOD__ );
+ if ( $row ) {
+ $this->mTitle = Title::newFromRow( $row );
}
return $this->mTitle;
}
$id = 0;
}
$conds = array( 'rev_id' => $id );
- $conds['rev_page'] = $title->getArticleId();
+ $conds['rev_page'] = $title->getArticleID();
$timestamp = $dbr->selectField( 'revision', 'rev_timestamp', $conds, __METHOD__ );
if ( $timestamp === false && wfGetLB()->getServerCount() > 1 ) {
# Not in slave, try master
* @return Integer
*/
static function countByTitle( $db, $title ) {
- $id = $title->getArticleId();
+ $id = $title->getArticleID();
if( $id ) {
return Revision::countByPageId( $db, $id );
}