19 private $newLinks = [];
21 private $existingLinks;
27 $parserOutput->
getLinkList( ParserOutputLinkTypes::LANGUAGE )
28 as [
'link' => $link ]
30 $key = $link->getInterwiki();
31 $title = $link->getText();
32 if ( $link->hasFragment() ) {
33 $title .=
'#' . $link->getFragment();
37 $this->newLinks[$key] ??= $title;
53 return [
'll_lang',
'll_title' ];
58 foreach ( $this->newLinks as $key => $title ) {
59 yield [ (string)$key, $title ];
69 private function getExistingLinks() {
70 if ( $this->existingLinks ===
null ) {
71 $this->existingLinks = [];
73 $this->existingLinks[$row->ll_lang] = $row->ll_title;
76 return $this->existingLinks;
81 foreach ( $this->getExistingLinks() as $lang => $title ) {
82 yield [ (string)$lang, $title ];
88 $links = $this->getExistingLinks();
89 [ $lang, $title ] = $linkId;
90 return \array_key_exists( $lang, $links )
91 && $links[$lang] === $title;
96 [ $lang, $title ] = $linkId;
97 return \array_key_exists( $lang, $this->newLinks )
98 && $this->newLinks[$lang] === $title;
103 [ $lang, $title ] = $linkId;
113 'll_lang' => $linkId[0]