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;
50 return [
'll_lang',
'll_title' ];
54 foreach ( $this->newLinks as $key => $title ) {
55 yield [ (string)$key, $title ];
65 private function getExistingLinks() {
66 if ( $this->existingLinks ===
null ) {
67 $this->existingLinks = [];
69 $this->existingLinks[$row->ll_lang] = $row->ll_title;
72 return $this->existingLinks;
76 foreach ( $this->getExistingLinks() as $lang => $title ) {
77 yield [ (string)$lang, $title ];
82 $links = $this->getExistingLinks();
83 [ $lang, $title ] = $linkId;
84 return \array_key_exists( $lang, $links )
85 && $links[$lang] === $title;
89 [ $lang, $title ] = $linkId;
90 return \array_key_exists( $lang, $this->newLinks )
91 && $this->newLinks[$lang] === $title;
95 [ $lang, $title ] = $linkId;
104 'll_lang' => $linkId[0]