MediaWiki REL1_37
LinkBatchFactory.php
Go to the documentation of this file.
1<?php
24namespace MediaWiki\Cache;
25
26use GenderCache;
27use Language;
28use LinkBatch;
29use LinkCache;
34
40
44 private $linkCache;
45
50
55
59 private $genderCache;
60
65
66 public function __construct(
72 ) {
73 $this->linkCache = $linkCache;
74 $this->titleFormatter = $titleFormatter;
75 $this->contentLanguage = $contentLanguage;
76 $this->genderCache = $genderCache;
77 $this->loadBalancer = $loadBalancer;
78 }
79
85 public function newLinkBatch( iterable $initialItems = [] ): LinkBatch {
86 $batch = new LinkBatch(
87 [],
88 $this->linkCache,
89 $this->titleFormatter,
90 $this->contentLanguage,
91 $this->genderCache,
92 $this->loadBalancer
93 );
94
95 foreach ( $initialItems as $item ) {
96 $batch->addObj( $item );
97 }
98
99 return $batch;
100 }
101}
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:42
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition LinkBatch.php:42
addObj( $link)
Cache for article titles (prefixed DB keys) and ids linked from one source.
Definition LinkCache.php:41
__construct(LinkCache $linkCache, TitleFormatter $titleFormatter, Language $contentLanguage, GenderCache $genderCache, ILoadBalancer $loadBalancer)
newLinkBatch(iterable $initialItems=[])
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
A title formatter service for MediaWiki.
Database cluster connection, tracking, load balancing, and transaction manager interface.