| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Deferred\LinksUpdate; |
| 4 |
|
| 5 |
use LogicException; |
| 6 |
use MediaWiki\Parser\ParserOutput; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
class TemplateLinksTable extends GenericPageLinksTable { |
| 14 |
public function setParserOutput( ParserOutput $parserOutput ) { |
| 15 |
$this->newLinks = $parserOutput->getTemplates(); |
| 16 |
} |
| 17 |
|
| 18 |
protected function getTableName() { |
| 19 |
return 'templatelinks'; |
| 20 |
} |
| 21 |
|
| 22 |
protected function getFromField() { |
| 23 |
return 'tl_from'; |
| 24 |
} |
| 25 |
|
| 26 |
protected function getNamespaceField() { |
| 27 |
|
| 28 |
throw new LogicException( 'not supported' ); |
| 29 |
} |
| 30 |
|
| 31 |
protected function getTitleField() { |
| 32 |
|
| 33 |
throw new LogicException( 'not supported' ); |
| 34 |
} |
| 35 |
|
| 36 |
protected function getFromNamespaceField() { |
| 37 |
return 'tl_from_namespace'; |
| 38 |
} |
| 39 |
|
| 40 |
protected function getTargetIdField() { |
| 41 |
return 'tl_target_id'; |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
protected function linksTargetNormalizationStage(): int { |
| 49 |
return MIGRATION_NEW; |
| 50 |
} |
| 51 |
} |