Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Specials\SpecialSetSiteLink Class Reference

Special page for setting the sitepage of a Wikibase entity. More...

+ Inheritance diagram for Wikibase\Repo\Specials\SpecialSetSiteLink:
+ Collaboration diagram for Wikibase\Repo\Specials\SpecialSetSiteLink:

Public Member Functions

 __construct (SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediawikiEditEntityFactory $editEntityFactory, SiteLookup $siteLookup, SiteLinkTargetProvider $siteLinkTargetProvider, array $siteLinkGroups, array $badgeItems, LanguageFallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory, SiteLinkChangeOpFactory $siteLinkChangeOpFactory)
 
 doesWrites ()
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialModifyEntity
 __construct ( $title, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediawikiEditEntityFactory $editEntityFactory)
 
 execute ( $subPage)
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibaseRepoPage
 __construct ( $title, $restriction, SpecialPageCopyrightView $copyrightView, SummaryFormatter $summaryFormatter, EntityTitleLookup $entityTitleLookup, MediawikiEditEntityFactory $editEntityFactory)
 
- Public Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 __construct ( $name='', $restriction='', $listed=true)
 
 getDescription ()
 
 setHeaders ()
 

Static Public Member Functions

static factory (SiteLookup $siteLookup, ChangeOpFactoryProvider $changeOpFactoryProvider, MediawikiEditEntityFactory $editEntityFactory, EntityTitleLookup $entityTitleLookup, LanguageFallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory, SettingsArray $repoSettings, SummaryFormatter $summaryFormatter)
 

Protected Member Functions

 processArguments ( $subPage)
 
 validateInput ()
 
 modifyEntity (EntityDocument $entity)
 
 getForm (EntityDocument $entity=null)
 
- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialModifyEntity
 getEntityId ()
 Returns the ID of the Entity being modified. More...
 
 getBaseRevision ()
 Returns the base revision. More...
 
 getLatestRevision ()
 Returns the current revision. More...
 
 getEntityForModification ()
 Returns the EntityDocument that is to be modified by code in this class (or subclasses). More...
 
 getEntityForDisplay ()
 Returns the EntityDocument that is to be shown by code in this class (or subclasses). More...
 
 getFormElements (EntityDocument $entity=null)
 
 isModificationRequested ()
 Whether the current request is a request for modification (as opposed to a request for showing the input form). More...
 
 applyChangeOp (ChangeOp $changeOp, EntityDocument $entity, Summary $summary=null)
 Applies the given ChangeOp to the given Entity. More...
 
- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibaseRepoPage
 prepareEditEntity (EntityId $id=null, $baseRev=0)
 
 getEditEntity ()
 Returns the EditEntity interactor. More...
 
 parseEntityId ( $rawId)
 Parses an entity id. More...
 
 parseItemId ( $rawId)
 Parses an item id. More...
 
 getEntityTitle (EntityId $id)
 
 saveEntity (EntityDocument $entity, FormatableSummary $summary, $token, $flags=EDIT_UPDATE)
 Saves the entity using the given summary. More...
 
 getCopyrightHTML ( $saveMessageKey=null)
 
- Protected Member Functions inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 getGroupName ()
 
 checkBlocked ()
 Checks if user is blocked, and if blocked throws a UserBlocked. More...
 
 showErrorHTML ( $error)
 

Private Member Functions

 isValidSiteId ( $siteId)
 Checks if the site id is valid. More...
 
 getSiteLink (?Item $item, $siteId)
 Returning the site page of the entity. More...
 
 getBadges (?Item $item, $siteId)
 Returning the badges of the entity. More...
 
 parseBadges (array $badges, Status $status)
 Validates badges from params and turns them into an array of ItemIds. More...
 
 setSiteLink (EntityDocument $item, $siteId, $pageName, array $badgeIds, Summary &$summary=null)
 Setting the sitepage of the entity. More...
 

Private Attributes

 $siteLookup
 
 $siteLinkTargetProvider
 
 $siteLinkGroups
 
 $badgeItems
 
 $labelDescriptionLookupFactory
 
 $siteLinkChangeOpFactory
 
 $site
 
 $page
 
 $badges
 

Additional Inherited Members

- Protected Attributes inherited from Wikibase\Repo\Specials\SpecialWikibaseRepoPage
 $summaryFormatter
 
- Protected Attributes inherited from Wikibase\Repo\Specials\SpecialWikibasePage
 $stringNormalizer
 

Detailed Description

Special page for setting the sitepage of a Wikibase entity.

Author
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@goog.nosp@m.lema.nosp@m.il.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Specials\SpecialSetSiteLink::__construct ( SpecialPageCopyrightView  $copyrightView,
SummaryFormatter  $summaryFormatter,
EntityTitleLookup  $entityTitleLookup,
MediawikiEditEntityFactory  $editEntityFactory,
SiteLookup  $siteLookup,
SiteLinkTargetProvider  $siteLinkTargetProvider,
array  $siteLinkGroups,
array  $badgeItems,
LanguageFallbackLabelDescriptionLookupFactory  $labelDescriptionLookupFactory,
SiteLinkChangeOpFactory  $siteLinkChangeOpFactory 
)
Parameters
SpecialPageCopyrightView$copyrightView
SummaryFormatter$summaryFormatter
EntityTitleLookup$entityTitleLookup
MediawikiEditEntityFactory$editEntityFactory
SiteLookup$siteLookup
SiteLinkTargetProvider$siteLinkTargetProvider
string[]$siteLinkGroups
string[]$badgeItems
LanguageFallbackLabelDescriptionLookupFactory$labelDescriptionLookupFactory
SiteLinkChangeOpFactory$siteLinkChangeOpFactory

Member Function Documentation

◆ doesWrites()

Wikibase\Repo\Specials\SpecialSetSiteLink::doesWrites ( )

◆ factory()

static Wikibase\Repo\Specials\SpecialSetSiteLink::factory ( SiteLookup  $siteLookup,
ChangeOpFactoryProvider  $changeOpFactoryProvider,
MediawikiEditEntityFactory  $editEntityFactory,
EntityTitleLookup  $entityTitleLookup,
LanguageFallbackLabelDescriptionLookupFactory  $labelDescriptionLookupFactory,
SettingsArray  $repoSettings,
SummaryFormatter  $summaryFormatter 
)
static

◆ getBadges()

Wikibase\Repo\Specials\SpecialSetSiteLink::getBadges ( ?Item  $item,
  $siteId 
)
private

Returning the badges of the entity.

Parameters
Item | null$item
string$siteId
Exceptions
OutOfBoundsException
Returns
string[]

◆ getForm()

Wikibase\Repo\Specials\SpecialSetSiteLink::getForm ( EntityDocument  $entity = null)
protected
See also
SpecialModifyEntity::getForm()
Parameters
EntityDocument | null$entity
Returns
HTMLForm

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ getSiteLink()

Wikibase\Repo\Specials\SpecialSetSiteLink::getSiteLink ( ?Item  $item,
  $siteId 
)
private

Returning the site page of the entity.

Parameters
Item | null$item
string$siteId
Exceptions
OutOfBoundsException
Returns
string

◆ isValidSiteId()

Wikibase\Repo\Specials\SpecialSetSiteLink::isValidSiteId (   $siteId)
private

Checks if the site id is valid.

Parameters
string$siteIdthe site id
Returns
bool

◆ modifyEntity()

Wikibase\Repo\Specials\SpecialSetSiteLink::modifyEntity ( EntityDocument  $entity)
protected
See also
SpecialModifyEntity::modifyEntity()
Parameters
EntityDocument$entity
Returns
Summary|bool The summary or false

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ parseBadges()

Wikibase\Repo\Specials\SpecialSetSiteLink::parseBadges ( array  $badges,
Status  $status 
)
private

Validates badges from params and turns them into an array of ItemIds.

Parameters
string[]$badges
Status$status
Returns
ItemId[]|boolean

◆ processArguments()

Wikibase\Repo\Specials\SpecialSetSiteLink::processArguments (   $subPage)
protected
See also
SpecialModifyEntity::processArguments()
Parameters
string | null$subPage

Reimplemented from Wikibase\Repo\Specials\SpecialModifyEntity.

◆ setSiteLink()

Wikibase\Repo\Specials\SpecialSetSiteLink::setSiteLink ( EntityDocument  $item,
  $siteId,
  $pageName,
array  $badgeIds,
Summary $summary = null 
)
private

Setting the sitepage of the entity.

Parameters
EntityDocument$item
string$siteId
string$pageName
string[]$badgeIds
Summary | null&$summaryThe summary for this edit will be saved here.
Exceptions
InvalidArgumentException
Returns
Status

◆ validateInput()

Wikibase\Repo\Specials\SpecialSetSiteLink::validateInput ( )
protected

Member Data Documentation

◆ $badgeItems

Wikibase\Repo\Specials\SpecialSetSiteLink::$badgeItems
private

◆ $badges

Wikibase\Repo\Specials\SpecialSetSiteLink::$badges
private

◆ $labelDescriptionLookupFactory

Wikibase\Repo\Specials\SpecialSetSiteLink::$labelDescriptionLookupFactory
private

◆ $page

Wikibase\Repo\Specials\SpecialSetSiteLink::$page
private

◆ $site

Wikibase\Repo\Specials\SpecialSetSiteLink::$site
private

◆ $siteLinkChangeOpFactory

Wikibase\Repo\Specials\SpecialSetSiteLink::$siteLinkChangeOpFactory
private

◆ $siteLinkGroups

Wikibase\Repo\Specials\SpecialSetSiteLink::$siteLinkGroups
private

◆ $siteLinkTargetProvider

Wikibase\Repo\Specials\SpecialSetSiteLink::$siteLinkTargetProvider
private

◆ $siteLookup

Wikibase\Repo\Specials\SpecialSetSiteLink::$siteLookup
private

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