73 public function fetch( $prefix ) {
74 if ( $prefix ==
'' ) {
82 return $this->interwikiMap[$prefix];
94 if ( $local ===
null || $interwiki->isLocal() === $local ) {
96 'iw_prefix' => $interwikiId,
97 'iw_url' => $interwiki->getURL(),
98 'iw_api' => $interwiki->getAPI(),
99 'iw_wikiid' => $interwiki->getWikiID(),
100 'iw_local' => $interwiki->isLocal(),
101 'iw_trans' => $interwiki->isTranscludable(),
114 if ( !isset( $this->interwikiMap[$prefix] ) ) {
117 $globalId = $this->interwikiMap[$prefix]->getWikiID();
118 unset( $this->interwikiMap[$prefix] );
121 $site = $this->siteLookup->getSites()->getSite( $globalId );
123 $this->interwikiMap = array_merge( $this->interwikiMap, [ $interwikis[$prefix] ] );
131 $siteList = $this->siteLookup->getSites();
132 foreach ( $siteList as $site ) {
145 if ( $this->interwikiMap ===
null ) {
159 foreach ( $site->getInterwikiIds() as $interwiki ) {
160 $url = $site->getPageUrl();
162 $path = $site->getFileUrl(
'api.php' );
166 $local = $site->getSource() ===
'local';
172 $site->getGlobalId(),
Value object for representing interwiki records.