MediaWiki  master
MediaWiki\Title\TitleFactory Class Reference

Creates Title objects. More...

Public Member Functions

 castFromLinkTarget (?LinkTarget $linkTarget)
 
 castFromPageIdentity (?PageIdentity $pageIdentity)
 
 castFromPageReference (?PageReference $pageReference)
 
 makeTitle ( $ns, $title, $fragment='', $interwiki='')
 
 makeTitleSafe ( $ns, $title, $fragment='', $interwiki='')
 
 newFromDBkey ( $key)
 
 newFromID ( $id, $flags=0)
 
 newFromIDs ( $ids)
 
 newFromLinkTarget (LinkTarget $linkTarget, $forceClone='')
 
 newFromPageIdentity (PageIdentity $pageIdentity)
 
 newFromPageReference (PageReference $pageReference)
 
 newFromRow ( $row)
 
 newFromText ( $text, $defaultNamespace=NS_MAIN)
 
 newFromTextThrow ( $text, $defaultNamespace=NS_MAIN)
 
 newFromURL ( $url)
 
 newMainPage (MessageLocalizer $localizer=null)
 

Detailed Description

Creates Title objects.

For now, there is nothing interesting in this class. It is meant for preventing static Title methods causing problems in unit tests.

Since
1.35

Definition at line 39 of file TitleFactory.php.

Member Function Documentation

◆ castFromLinkTarget()

MediaWiki\Title\TitleFactory::castFromLinkTarget ( ?LinkTarget  $linkTarget)
See also
Title::castFromLinkTarget
Parameters
LinkTarget | null$linkTarget
Returns
Title|null

Definition at line 65 of file TitleFactory.php.

◆ castFromPageIdentity()

MediaWiki\Title\TitleFactory::castFromPageIdentity ( ?PageIdentity  $pageIdentity)
See also
Title::castFromPageIdentity
Since
1.36
Parameters
PageIdentity | null$pageIdentity
Returns
Title|null

Definition at line 85 of file TitleFactory.php.

◆ castFromPageReference()

MediaWiki\Title\TitleFactory::castFromPageReference ( ?PageReference  $pageReference)
See also
Title::castFromPageReference
Since
1.37
Parameters
PageReference | null$pageReference
Returns
Title|null

Definition at line 105 of file TitleFactory.php.

◆ makeTitle()

MediaWiki\Title\TitleFactory::makeTitle (   $ns,
  $title,
  $fragment = '',
  $interwiki = '' 
)
See also
Title::makeTitle
Parameters
int$ns
string$title
string$fragment
string$interwiki
Returns
Title

Definition at line 178 of file TitleFactory.php.

◆ makeTitleSafe()

MediaWiki\Title\TitleFactory::makeTitleSafe (   $ns,
  $title,
  $fragment = '',
  $interwiki = '' 
)
See also
Title::makeTitleSafe
Parameters
int$ns
string$title
string$fragment
string$interwiki
Returns
Title|null

Definition at line 190 of file TitleFactory.php.

◆ newFromDBkey()

MediaWiki\Title\TitleFactory::newFromDBkey (   $key)
See also
Title::newFromDBkey
Parameters
string$key
Returns
Title|null

Definition at line 46 of file TitleFactory.php.

◆ newFromID()

MediaWiki\Title\TitleFactory::newFromID (   $id,
  $flags = 0 
)
See also
Title::newFromID
Parameters
int$id
int$flags
Returns
Title|null

Definition at line 146 of file TitleFactory.php.

◆ newFromIDs()

MediaWiki\Title\TitleFactory::newFromIDs (   $ids)
Deprecated:
since 1.38 use a PageStore QueryBuilder instead
See also
Title::newFromIDs
Parameters
int[]$ids
Returns
Title[]

Definition at line 156 of file TitleFactory.php.

◆ newFromLinkTarget()

MediaWiki\Title\TitleFactory::newFromLinkTarget ( LinkTarget  $linkTarget,
  $forceClone = '' 
)
See also
Title::newFromLinkTarget
Parameters
LinkTarget$linkTarget
string$forceClone
Returns
Title

Definition at line 56 of file TitleFactory.php.

◆ newFromPageIdentity()

MediaWiki\Title\TitleFactory::newFromPageIdentity ( PageIdentity  $pageIdentity)
See also
Title::newFromPageIdentity
Since
1.41
Parameters
PageIdentity$pageIdentity
Returns
Title

Definition at line 75 of file TitleFactory.php.

◆ newFromPageReference()

MediaWiki\Title\TitleFactory::newFromPageReference ( PageReference  $pageReference)
See also
Title::newFromPageReference
Since
1.41
Parameters
PageReference$pageReference
Returns
Title

Definition at line 95 of file TitleFactory.php.

◆ newFromRow()

MediaWiki\Title\TitleFactory::newFromRow (   $row)
See also
Title::newFromRow
Parameters
\\stdClass$row
Returns
Title

Definition at line 166 of file TitleFactory.php.

◆ newFromText()

MediaWiki\Title\TitleFactory::newFromText (   $text,
  $defaultNamespace = NS_MAIN 
)
See also
Title::newFromText
Parameters
string | int | null$text
int$defaultNamespace
Returns
Title|null
Exceptions

Definition at line 116 of file TitleFactory.php.

◆ newFromTextThrow()

MediaWiki\Title\TitleFactory::newFromTextThrow (   $text,
  $defaultNamespace = NS_MAIN 
)
See also
Title::newFromTextThrow
Parameters
string$text
int$defaultNamespace
Returns
Title
Exceptions
MalformedTitleException

Definition at line 127 of file TitleFactory.php.

◆ newFromURL()

MediaWiki\Title\TitleFactory::newFromURL (   $url)
See also
Title::newFromURL
Parameters
string$url
Returns
Title|null

Definition at line 136 of file TitleFactory.php.

◆ newMainPage()

MediaWiki\Title\TitleFactory::newMainPage ( MessageLocalizer  $localizer = null)
See also
Title::newMainPage
Parameters
MessageLocalizer | null$localizer
Returns
Title

Definition at line 199 of file TitleFactory.php.


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