}
public function getQueryInfo() {
- return array(
- 'tables' => array( 'templatelinks' ),
- 'fields' => array(
+ return [
+ 'tables' => [ 'templatelinks' ],
+ 'fields' => [
'namespace' => 'tl_namespace',
'title' => 'tl_title',
'value' => 'COUNT(*)'
- ),
- 'options' => array( 'GROUP BY' => array( 'tl_namespace', 'tl_title' ) )
- );
+ ],
+ 'options' => [ 'GROUP BY' => [ 'tl_namespace', 'tl_title' ] ]
+ ];
}
/**
* @param ResultWrapper $res
*/
public function preprocessResults( $db, $res ) {
- if ( !$res->numRows() ) {
- return;
- }
-
- $batch = new LinkBatch();
- foreach ( $res as $row ) {
- $batch->add( $row->namespace, $row->title );
- }
- $batch->execute();
-
- $res->seek( 0 );
+ $this->executeLBFromResultWrapper( $res );
}
/**
if ( !$title ) {
return Html::element(
'span',
- array( 'class' => 'mw-invalidtitle' ),
+ [ 'class' => 'mw-invalidtitle' ],
Linker::getInvalidTitleDescription(
$this->getContext(),
$result->namespace,