aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Revision.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/Revision.php')
-rw-r--r--includes/Revision.php48
1 files changed, 21 insertions, 27 deletions
diff --git a/includes/Revision.php b/includes/Revision.php
index 6b8aabc64047..98b8a0de9432 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -381,9 +381,7 @@ class Revision {
'page_namespace',
'page_title',
'page_id',
- 'page_latest',
- 'page_is_redirect',
- 'page_len',
+ 'page_latest'
);
}
@@ -495,7 +493,7 @@ class Revision {
/**
* Get revision ID
*
- * @return Integer|null
+ * @return Integer
*/
public function getId() {
return $this->mId;
@@ -514,7 +512,7 @@ class Revision {
/**
* Get text row ID
*
- * @return Integer|null
+ * @return Integer
*/
public function getTextId() {
return $this->mTextId;
@@ -532,7 +530,7 @@ class Revision {
/**
* Returns the length of the text in this revision, or null if unknown.
*
- * @return Integer|null
+ * @return Integer
*/
public function getSize() {
return $this->mSize;
@@ -541,34 +539,30 @@ class Revision {
/**
* Returns the base36 sha1 of the text in this revision, or null if unknown.
*
- * @return String|null
+ * @return String
*/
public function getSha1() {
return $this->mSha1;
}
/**
- * Returns the title of the page associated with this entry or null.
+ * Returns the title of the page associated with this entry.
*
- * Will do a query, when title is not set and id is given.
- *
- * @return Title|null
+ * @return Title
*/
public function getTitle() {
if( isset( $this->mTitle ) ) {
return $this->mTitle;
}
- if( !is_null( $this->mId ) ) { //rev_id is defined as NOT NULL
- $dbr = wfGetDB( DB_SLAVE );
- $row = $dbr->selectRow(
- array( 'page', 'revision' ),
- self::selectPageFields(),
- array( 'page_id=rev_page',
- 'rev_id' => $this->mId ),
- __METHOD__ );
- if ( $row ) {
- $this->mTitle = Title::newFromRow( $row );
- }
+ $dbr = wfGetDB( DB_SLAVE );
+ $row = $dbr->selectRow(
+ array( 'page', 'revision' ),
+ self::selectPageFields(),
+ array( 'page_id=rev_page',
+ 'rev_id' => $this->mId ),
+ __METHOD__ );
+ if ( $row ) {
+ $this->mTitle = Title::newFromRow( $row );
}
return $this->mTitle;
}
@@ -585,7 +579,7 @@ class Revision {
/**
* Get the page ID
*
- * @return Integer|null
+ * @return Integer
*/
public function getPage() {
return $this->mPage;
@@ -598,7 +592,7 @@ class Revision {
*
* @param $audience Integer: one of:
* Revision::FOR_PUBLIC to be displayed to all users
- * Revision::FOR_THIS_USER to be displayed to the given user
+ * Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the ID regardless of permissions
* @param $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
@@ -630,7 +624,7 @@ class Revision {
*
* @param $audience Integer: one of:
* Revision::FOR_PUBLIC to be displayed to all users
- * Revision::FOR_THIS_USER to be displayed to the given user
+ * Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the text regardless of permissions
* @param $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
@@ -670,7 +664,7 @@ class Revision {
*
* @param $audience Integer: one of:
* Revision::FOR_PUBLIC to be displayed to all users
- * Revision::FOR_THIS_USER to be displayed to the given user
+ * Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the text regardless of permissions
* @param $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
@@ -748,7 +742,7 @@ class Revision {
*
* @param $audience Integer: one of:
* Revision::FOR_PUBLIC to be displayed to all users
- * Revision::FOR_THIS_USER to be displayed to the given user
+ * Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the text regardless of permissions
* @param $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter