* @param Title $title
* @param int $id
* @return Revision
- * @access public
- * @static
*/
- public static function newFromTitle( &$title, $id = 0 ) {
+ public static function newFromTitle( $title, $id = 0 ) {
if( $id ) {
$matchId = intval( $id );
} else {
* @access public
* @static
*/
- public static function loadFromId( &$db, $id ) {
+ public static function loadFromId( $db, $id ) {
return Revision::loadFromConds( $db,
array( 'page_id=rev_page',
'rev_id' => intval( $id ) ) );
* @access public
* @static
*/
- public static function loadFromTitle( &$db, $title, $id = 0 ) {
+ public static function loadFromTitle( $db, $title, $id = 0 ) {
if( $id ) {
$matchId = intval( $id );
} else {
* @access public
* @static
*/
- public static function loadFromTimestamp( &$db, &$title, $timestamp ) {
+ public static function loadFromTimestamp( $db, $title, $timestamp ) {
return Revision::loadFromConds(
$db,
array( 'rev_timestamp' => $db->timestamp( $timestamp ),
* @access public
* @static
*/
- public static function fetchAllRevisions( &$title ) {
+ public static function fetchAllRevisions( $title ) {
return Revision::fetchFromConds(
wfGetDB( DB_SLAVE ),
array( 'page_namespace' => $title->getNamespace(),
* @access public
* @static
*/
- public static function fetchRevision( &$title ) {
+ public static function fetchRevision( $title ) {
return Revision::fetchFromConds(
wfGetDB( DB_SLAVE ),
array( 'rev_id=page_latest',
'rev_id' => $this->mId ),
'Revision::getTitle' );
if( $row ) {
- $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
+ $this->mTitle = Title::makeTitle( $row->page_namespace,
+ $row->page_title );
}
return $this->mTitle;
}
* @return Revision
*/
public function getPrevious() {
- $prev = $this->getTitle() ? $this->getTitle()->getPreviousRevisionID( $this->mId ) : null;
- if( $prev ) {
- return Revision::newFromTitle( $this->mTitle, $prev );
- } else {
- return null;
+ if( $this->getTitle() ) {
+ $prev = $this->getTitle()->getPreviousRevisionID( $this->getId() );
+ if( $prev ) {
+ return Revision::newFromTitle( $this->getTitle(), $prev );
+ }
}
+ return null;
}
/**
* @return Revision
*/
public function getNext() {
- $next = $this->getTitle() ? $this->getTitle()->getNextRevisionID( $this->mId ) : null;
- if ( $next ) {
- return Revision::newFromTitle( $this->mTitle, $next );
- } else {
- return null;
+ if( $this->getTitle() ) {
+ $next = $this->getTitle()->getNextRevisionID( $this->getId() );
+ if ( $next ) {
+ return Revision::newFromTitle( $this->getTitle(), $next );
+ }
}
+ return null;
}
/**
* @param Database $dbw
* @return int
*/
- public function insertOn( &$dbw ) {
+ public function insertOn( $dbw ) {
global $wgDefaultExternalStore;
wfProfileIn( __METHOD__ );
* @param bool $minor
* @return Revision
*/
- public static function newNullRevision( &$dbw, $pageId, $summary, $minor ) {
+ public static function newNullRevision( $dbw, $pageId, $summary, $minor ) {
wfProfileIn( __METHOD__ );
$current = $dbw->selectRow(
if( ( $this->mDeleted & $field ) == $field ) {
global $wgUser;
$permission = ( $this->mDeleted & self::DELETED_RESTRICTED ) == self::DELETED_RESTRICTED
- ? 'hiderevision'
+ ? 'suppressrevision'
: 'deleterevision';
wfDebug( "Checking for $permission due to $field match on $this->mDeleted\n" );
return $wgUser->isAllowed( $permission );
* @param integer $id
* @param integer $pageid, optional
*/
- static function getTimestampFromID( $id, $pageId = 0 ) {
+ static function getTimestampFromId( $id, $pageId = 0 ) {
$dbr = wfGetDB( DB_SLAVE );
$conds = array( 'rev_id' => $id );
if( $pageId ) {