Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\View\ViewFactory Class Reference

This is a basic factory to create views for DataModel objects. More...

Public Member Functions

 __construct (EntityIdFormatterFactory $htmlIdFormatterFactory, EntityIdFormatterFactory $plainTextIdFormatterFactory, HtmlSnakFormatterFactory $htmlSnakFormatterFactory, StatementGrouper $statementGrouper, PropertyOrderProvider $propertyOrderProvider, SiteLookup $siteLookup, DataTypeFactory $dataTypeFactory, TemplateFactory $templateFactory, LanguageNameLookup $languageNameLookup, LanguageDirectionalityLookup $languageDirectionalityLookup, NumberLocalizer $numberLocalizer, array $siteLinkGroups, array $specialSiteLinkGroups, array $badgeItems, LocalizedTextProvider $textProvider, SpecialPageLinker $specialPageLinker)
 
 newItemView (Language $language, LanguageFallbackChain $fallbackChain, CacheableEntityTermsView $entityTermsView)
 Creates an ItemView suitable for rendering the item.
 
 newPropertyView (Language $language, LanguageFallbackChain $fallbackChain, CacheableEntityTermsView $entityTermsView)
 Creates an PropertyView suitable for rendering the property.
 
 newStatementSectionsView ( $languageCode, LanguageFallbackChain $fallbackChain, EditSectionGenerator $editSectionGenerator)
 
 newStatementGroupListView ( $languageCode, LanguageFallbackChain $fallbackChain, EditSectionGenerator $editSectionGenerator)
 

Private Member Functions

 hasValidOutputFormat (EntityIdFormatterFactory $factory, $expected)
 
 newToolbarEditSectionGenerator ()
 

Private Attributes

 $htmlSnakFormatterFactory
 
 $htmlIdFormatterFactory
 
 $plainTextIdFormatterFactory
 
 $statementGrouper
 
 $propertyOrderProvider
 
 $siteLookup
 
 $dataTypeFactory
 
 $templateFactory
 
 $languageNameLookup
 
 $languageDirectionalityLookup
 
 $numberLocalizer
 
 $siteLinkGroups
 
 $specialSiteLinkGroups
 
 $badgeItems
 
 $textProvider
 
 $specialPageLinker
 

Detailed Description

This is a basic factory to create views for DataModel objects.

It contains all dependencies of the views besides request-specific options. Those are required in the parameters.

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Thiemo Kreuz
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\ViewFactory::__construct ( EntityIdFormatterFactory  $htmlIdFormatterFactory,
EntityIdFormatterFactory  $plainTextIdFormatterFactory,
HtmlSnakFormatterFactory  $htmlSnakFormatterFactory,
StatementGrouper  $statementGrouper,
PropertyOrderProvider  $propertyOrderProvider,
SiteLookup  $siteLookup,
DataTypeFactory  $dataTypeFactory,
TemplateFactory  $templateFactory,
LanguageNameLookup  $languageNameLookup,
LanguageDirectionalityLookup  $languageDirectionalityLookup,
NumberLocalizer  $numberLocalizer,
array  $siteLinkGroups,
array  $specialSiteLinkGroups,
array  $badgeItems,
LocalizedTextProvider  $textProvider,
SpecialPageLinker  $specialPageLinker 
)
Parameters
EntityIdFormatterFactory$htmlIdFormatterFactory
EntityIdFormatterFactory$plainTextIdFormatterFactory
HtmlSnakFormatterFactory$htmlSnakFormatterFactory
StatementGrouper$statementGrouper
PropertyOrderProvider$propertyOrderProvider
SiteLookup$siteLookup
DataTypeFactory$dataTypeFactory
TemplateFactory$templateFactory
LanguageNameLookup$languageNameLookup
LanguageDirectionalityLookup$languageDirectionalityLookup
NumberLocalizer$numberLocalizer
string[]$siteLinkGroups
string[]$specialSiteLinkGroups
string[]$badgeItems
LocalizedTextProvider$textProvider
SpecialPageLinker$specialPageLinker
Exceptions
InvalidArgumentException

Member Function Documentation

◆ hasValidOutputFormat()

Wikibase\View\ViewFactory::hasValidOutputFormat ( EntityIdFormatterFactory  $factory,
  $expected 
)
private
Parameters
EntityIdFormatterFactory$factory
string$expected
Returns
bool

◆ newItemView()

Wikibase\View\ViewFactory::newItemView ( Language  $language,
LanguageFallbackChain  $fallbackChain,
CacheableEntityTermsView  $entityTermsView 
)

Creates an ItemView suitable for rendering the item.

Parameters
Language$language
LanguageFallbackChain$fallbackChain
CacheableEntityTermsView$entityTermsView
Returns
ItemView
Exceptions

MWException

◆ newPropertyView()

Wikibase\View\ViewFactory::newPropertyView ( Language  $language,
LanguageFallbackChain  $fallbackChain,
CacheableEntityTermsView  $entityTermsView 
)

Creates an PropertyView suitable for rendering the property.

Parameters
Language$language
LanguageFallbackChain$fallbackChain
CacheableEntityTermsView$entityTermsView
Returns
PropertyView
Exceptions

MWException

◆ newStatementGroupListView()

Wikibase\View\ViewFactory::newStatementGroupListView (   $languageCode,
LanguageFallbackChain  $fallbackChain,
EditSectionGenerator  $editSectionGenerator 
)
Parameters
string$languageCode
LanguageFallbackChain$fallbackChain
EditSectionGenerator$editSectionGenerator
Returns
StatementGroupListView

◆ newStatementSectionsView()

Wikibase\View\ViewFactory::newStatementSectionsView (   $languageCode,
LanguageFallbackChain  $fallbackChain,
EditSectionGenerator  $editSectionGenerator 
)
Parameters
string$languageCode
LanguageFallbackChain$fallbackChain
EditSectionGenerator$editSectionGenerator
Returns
StatementSectionsView

◆ newToolbarEditSectionGenerator()

Wikibase\View\ViewFactory::newToolbarEditSectionGenerator ( )
private

Member Data Documentation

◆ $badgeItems

Wikibase\View\ViewFactory::$badgeItems
private

◆ $dataTypeFactory

Wikibase\View\ViewFactory::$dataTypeFactory
private

◆ $htmlIdFormatterFactory

Wikibase\View\ViewFactory::$htmlIdFormatterFactory
private

◆ $htmlSnakFormatterFactory

Wikibase\View\ViewFactory::$htmlSnakFormatterFactory
private

◆ $languageDirectionalityLookup

Wikibase\View\ViewFactory::$languageDirectionalityLookup
private

◆ $languageNameLookup

Wikibase\View\ViewFactory::$languageNameLookup
private

◆ $numberLocalizer

Wikibase\View\ViewFactory::$numberLocalizer
private

◆ $plainTextIdFormatterFactory

Wikibase\View\ViewFactory::$plainTextIdFormatterFactory
private

◆ $propertyOrderProvider

Wikibase\View\ViewFactory::$propertyOrderProvider
private

◆ $siteLinkGroups

Wikibase\View\ViewFactory::$siteLinkGroups
private

◆ $siteLookup

Wikibase\View\ViewFactory::$siteLookup
private

◆ $specialPageLinker

Wikibase\View\ViewFactory::$specialPageLinker
private

◆ $specialSiteLinkGroups

Wikibase\View\ViewFactory::$specialSiteLinkGroups
private

◆ $statementGrouper

Wikibase\View\ViewFactory::$statementGrouper
private

◆ $templateFactory

Wikibase\View\ViewFactory::$templateFactory
private

◆ $textProvider

Wikibase\View\ViewFactory::$textProvider
private

The documentation for this class was generated from the following file: