Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\RepoLinker Class Reference

Public Member Functions

 __construct (EntitySourceDefinitions $entitySourceDefinitions, $baseUrl, $articlePath, $scriptPath)
 
 getPageUrl ( $page)
 
 formatLink ( $url, $text, array $attribs=[])
 Format a link, with url encoding.
 
 buildEntityLink (EntityId $entityId, array $classes=[], $text=null)
 Constructs an html link to an entity.
 
 getEntityTitle (EntityId $entityId)
 
 getEntityUrl (EntityId $entityId)
 Constructs a link to an entity.
 
 getEntityConceptUri (EntityId $entityId)
 Constructs the machine followable link to an entity.
 
 getBaseUrl ()
 
 getApiUrl ()
 
 getIndexUrl ()
 
 addQueryParams ( $url, array $params)
 

Private Member Functions

 encodePage ( $page)
 
 getConceptBaseUri (EntityId $entityId)
 

Private Attributes

 $baseUrl
 
 $articlePath
 
 $scriptPath
 
 $entitySourceDefinitions
 

Detailed Description

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\RepoLinker::__construct ( EntitySourceDefinitions  $entitySourceDefinitions,
  $baseUrl,
  $articlePath,
  $scriptPath 
)
Parameters
EntitySourceDefinitions$entitySourceDefinitions
string$baseUrl
string$articlePath
string$scriptPath

Member Function Documentation

◆ addQueryParams()

Wikibase\Client\RepoLinker::addQueryParams (   $url,
array  $params 
)
Parameters
string$url
array$params
Returns
string

◆ buildEntityLink()

Wikibase\Client\RepoLinker::buildEntityLink ( EntityId  $entityId,
array  $classes = [],
  $text = null 
)

Constructs an html link to an entity.

Parameters
EntityId$entityId
array$classes
string$textDefaults to the entity id serialization.
Returns
string (html)

◆ encodePage()

Wikibase\Client\RepoLinker::encodePage (   $page)
private
Parameters
string$page
Returns
string

◆ formatLink()

Wikibase\Client\RepoLinker::formatLink (   $url,
  $text,
array  $attribs = [] 
)

Format a link, with url encoding.

Parameters
string$url
string$text
array$attribs
Returns
string (html)

◆ getApiUrl()

Wikibase\Client\RepoLinker::getApiUrl ( )
Returns
string

◆ getBaseUrl()

Wikibase\Client\RepoLinker::getBaseUrl ( )
Returns
string

◆ getConceptBaseUri()

Wikibase\Client\RepoLinker::getConceptBaseUri ( EntityId  $entityId)
private
Parameters
EntityId$entityId
Exceptions
LogicExceptionwhen there is no base URI for the repository $entityId belongs to
Returns
string

◆ getEntityConceptUri()

Wikibase\Client\RepoLinker::getEntityConceptUri ( EntityId  $entityId)

Constructs the machine followable link to an entity.

E.g., https://www.wikidata.org/entity/Q42.

Parameters
EntityId$entityId
Exceptions
LogicExceptionwhen there is no base URI for the repository $entityId belongs to
Returns
string

◆ getEntityTitle()

Wikibase\Client\RepoLinker::getEntityTitle ( EntityId  $entityId)
Parameters
EntityId$entityId
Returns
string

◆ getEntityUrl()

Wikibase\Client\RepoLinker::getEntityUrl ( EntityId  $entityId)

Constructs a link to an entity.

Parameters
EntityId$entityId
Returns
string

◆ getIndexUrl()

Wikibase\Client\RepoLinker::getIndexUrl ( )
Returns
string

◆ getPageUrl()

Wikibase\Client\RepoLinker::getPageUrl (   $page)
Parameters
string$page
Exceptions
InvalidArgumentException
Returns
string

Member Data Documentation

◆ $articlePath

Wikibase\Client\RepoLinker::$articlePath
private

◆ $baseUrl

Wikibase\Client\RepoLinker::$baseUrl
private

◆ $entitySourceDefinitions

Wikibase\Client\RepoLinker::$entitySourceDefinitions
private

◆ $scriptPath

Wikibase\Client\RepoLinker::$scriptPath
private

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