$lc->addGoodLinkObj( $data->page_id, $this->mTitle, $data->page_len, $data->page_is_redirect );
$this->mTitle->mArticleID = $data->page_id;
+ $this->mTitle->mTouched = wfTimestamp( TS_MW, $data->page_touched );
# Old-fashioned restrictions.
$this->mTitle->loadRestrictions( $data->page_restrictions );
var $mLength = -1; ///< The page length, 0 for special pages
var $mRedirect = null; ///< Is the article at this title a redirect?
var $mNotificationTimestamp = array(); ///< Associative array of user ID -> timestamp/false
+ var $mTouched = null; // <last cache date>
//@}
/**
* Get the last touched timestamp
- * @param Database $db, optional db
* @return \type{\string} Last touched timestamp
*/
- public function getTouched( $db = NULL ) {
- $db = isset($db) ? $db : wfGetDB( DB_SLAVE );
- $touched = $db->selectField( 'page', 'page_touched', $this->pageCond(), __METHOD__ );
- return $touched;
+ public function getTouched() {
+ if( !is_null($this->mTouched) ) {
+ return wfTimestamp( TS_MW, $this->mTouched );
+ }
+ $dbr = wfGetDB( DB_SLAVE );
+ $this->mTouched = $dbr->selectField( 'page', 'page_touched', $this->pageCond(), __METHOD__ );
+ return $this->mTouched;
}
/**