Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Config\Api\PageConfig Class Reference

PageConfig via MediaWiki's Action API. More...

+ Inheritance diagram for Wikimedia\Parsoid\Config\Api\PageConfig:
+ Collaboration diagram for Wikimedia\Parsoid\Config\Api\PageConfig:

Public Member Functions

 __construct (?ApiHelper $api, ISiteConfig $siteConfig, array $opts)
 
 getContentModel ()
 Get content model.
Returns
string

 
 getLinkTarget ()
 The page's title, as a LinkTarget.
Returns
LinkTarget

 
 getPageId ()
 The page's ID, if any.
Returns
int 0 if the page doesn't (yet?) exist

 
 getPageLanguageBcp47 ()
 The page's language code.
Returns
Bcp47Code a BCP-47 language code

 
 getPageLanguageDir ()
 The page's language direction.
Returns
string 'ltr' or 'rtl'

 
 getRevisionId ()
 The revision's ID, if any.
Returns
int|null

 
 getParentRevisionId ()
 The revision's parent ID, if any.
Returns
int|null

 
 getRevisionTimestamp ()
 The revision's timestamp, if any.
Returns
string|null "YYYYMMDDHHIISS" format

 
 getRevisionUser ()
 The revision's author's user name, if any.
Returns
string|null

 
 getRevisionUserId ()
 The revision's author's user ID, if any.
Returns
int|null 0 if the user is not registered

 
 getRevisionSha1 ()
 The revision's SHA1 checksum, if any.
Returns
string|null Hex encoded

 
 getRevisionSize ()
 The revision's length, if known.
Returns
int|null Bytes

 
 getRevisionContent ()
 The revision's content.
Returns
PageContent|null

 
- Public Member Functions inherited from Wikimedia\Parsoid\Config\PageConfig
 __construct ()
 Base constructor.
 
 getSuppressTOC ()
 Whether to suppress the Table of Contents for this page (a function of content model).
 
 getNs ()
 The page's namespace ID.
 
 getVariantBcp47 ()
 Get the page's language variant.
 
 setVariantBcp47 (Bcp47Code $htmlVariant)
 Set the page's language variant.
 
 getPageMainContent ()
 FIXME: Once we remove the hardcoded slot name here, the name of this method could be updated, if necessary.
 

Detailed Description

PageConfig via MediaWiki's Action API.

Note this is intended for testing, not performance.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Config\Api\PageConfig::__construct ( ?ApiHelper $api,
ISiteConfig $siteConfig,
array $opts )
Parameters
?ApiHelper$api(only needed if $opts doesn't provide page info)
ISiteConfig$siteConfig
array$opts

Member Function Documentation

◆ getContentModel()

Wikimedia\Parsoid\Config\Api\PageConfig::getContentModel ( )

Get content model.

Returns
string

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getLinkTarget()

Wikimedia\Parsoid\Config\Api\PageConfig::getLinkTarget ( )

The page's title, as a LinkTarget.

Returns
LinkTarget

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getPageId()

Wikimedia\Parsoid\Config\Api\PageConfig::getPageId ( )

The page's ID, if any.

Returns
int 0 if the page doesn't (yet?) exist

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getPageLanguageBcp47()

Wikimedia\Parsoid\Config\Api\PageConfig::getPageLanguageBcp47 ( )

The page's language code.

Returns
Bcp47Code a BCP-47 language code

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getPageLanguageDir()

Wikimedia\Parsoid\Config\Api\PageConfig::getPageLanguageDir ( )

The page's language direction.

Returns
string 'ltr' or 'rtl'

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getParentRevisionId()

Wikimedia\Parsoid\Config\Api\PageConfig::getParentRevisionId ( )

The revision's parent ID, if any.

Returns
int|null

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionContent()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionContent ( )

The revision's content.

Returns
PageContent|null

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionId()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionId ( )

The revision's ID, if any.

Returns
int|null

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionSha1()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionSha1 ( )

The revision's SHA1 checksum, if any.

Returns
string|null Hex encoded

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionSize()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionSize ( )

The revision's length, if known.

Returns
int|null Bytes

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionTimestamp()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionTimestamp ( )

The revision's timestamp, if any.

Returns
string|null "YYYYMMDDHHIISS" format

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionUser()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionUser ( )

The revision's author's user name, if any.

Returns
string|null

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.

◆ getRevisionUserId()

Wikimedia\Parsoid\Config\Api\PageConfig::getRevisionUserId ( )

The revision's author's user ID, if any.

Returns
int|null 0 if the user is not registered

Reimplemented from Wikimedia\Parsoid\Config\PageConfig.


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