MediaWiki REL1_35
LinkBatchFactory.php
Go to the documentation of this file.
1<?php
24namespace MediaWiki\Cache;
25
26use GenderCache;
27use Language;
28use LinkBatch;
29use LinkCache;
33
39
43 private $linkCache;
44
49
54
58 private $genderCache;
59
64
65 public function __construct(
71 ) {
72 $this->linkCache = $linkCache;
73 $this->titleFormatter = $titleFormatter;
74 $this->contentLanguage = $contentLanguage;
75 $this->genderCache = $genderCache;
76 $this->loadBalancer = $loadBalancer;
77 }
78
83 public function newLinkBatch( iterable $initialItems = [] ) : LinkBatch {
84 $batch = new LinkBatch(
85 [],
86 $this->linkCache,
87 $this->titleFormatter,
88 $this->contentLanguage,
89 $this->genderCache,
90 $this->loadBalancer
91 );
92
93 foreach ( $initialItems as $item ) {
94 $batch->addObj( $item );
95 }
96
97 return $batch;
98 }
99}
Caches user genders when needed to use correct namespace aliases.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition Language.php:41
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition LinkBatch.php:35
addObj( $linkTarget)
Cache for article titles (prefixed DB keys) and ids linked from one source.
Definition LinkCache.php:34
__construct(LinkCache $linkCache, TitleFormatter $titleFormatter, Language $contentLanguage, GenderCache $genderCache, ILoadBalancer $loadBalancer)
newLinkBatch(iterable $initialItems=[])
A title formatter service for MediaWiki.
Database cluster connection, tracking, load balancing, and transaction manager interface.