* @return Revision|null Null when there is no previous revision
*/
function getPreviousRevision( $timestamp ) {
* @return Revision|null Null when there is no previous revision
*/
function getPreviousRevision( $timestamp ) {
// Check the previous deleted revision...
$row = $dbr->selectRow( 'archive',
// Check the previous deleted revision...
$row = $dbr->selectRow( 'archive',
$text = $dbr->selectRow( 'text',
[ 'old_text', 'old_flags' ],
[ 'old_id' => $row->ar_text_id ],
$text = $dbr->selectRow( 'text',
[ 'old_text', 'old_flags' ],
[ 'old_id' => $row->ar_text_id ],
$row = $dbr->selectRow( 'archive',
[ 'ar_text', 'ar_flags', 'ar_text_id' ],
[ 'ar_namespace' => $this->title->getNamespace(),
$row = $dbr->selectRow( 'archive',
[ 'ar_text', 'ar_flags', 'ar_text_id' ],
[ 'ar_namespace' => $this->title->getNamespace(),
$n = $dbr->selectField( 'archive', 'COUNT(ar_title)',
[ 'ar_namespace' => $this->title->getNamespace(),
'ar_title' => $this->title->getDBkey() ],
$n = $dbr->selectField( 'archive', 'COUNT(ar_title)',
[ 'ar_namespace' => $this->title->getNamespace(),
'ar_title' => $this->title->getDBkey() ],