/** @return string */
public function getModelId() {
- return $modelId;
+ return $this->modelId;
}
}
*
* @since 1.21
*
- * @return array Always an empty array.
+ * @return array An array mapping action names (typically "view", "edit", "history" etc.) to
+ * either the full qualified class name of an Action class, a callable taking ( Page $page,
+ * IContextSource $context = null ) as parameters and returning an Action object, or an actual
+ * Action object. An empty array in this default implementation.
+ *
+ * @see Action::factory
*/
public function getActionOverrides() {
return [];
* have it / want it.
*/
public function getAutoDeleteReason( Title $title, &$hasHistory ) {
- $dbw = wfGetDB( DB_MASTER );
+ $dbr = wfGetDB( DB_SLAVE );
// Get the last revision
$rev = Revision::newFromTitle( $title );
// Find out if there was only one contributor
// Only scan the last 20 revisions
- $res = $dbw->select( 'revision', 'rev_user_text',
+ $res = $dbr->select( 'revision', 'rev_user_text',
[
'rev_page' => $title->getArticleID(),
- $dbw->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
+ $dbr->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0'
],
__METHOD__,
[ 'LIMIT' => 20 ]
}
$hasHistory = ( $res->numRows() > 1 );
- $row = $dbw->fetchObject( $res );
+ $row = $dbr->fetchObject( $res );
if ( $row ) { // $row is false if the only contributor is hidden
$onlyAuthor = $row->rev_user_text;