Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Parsers\MwEraParser Class Reference

Class to parse localized era from values. More...

+ Inheritance diagram for Wikibase\Repo\Parsers\MwEraParser:
+ Collaboration diagram for Wikibase\Repo\Parsers\MwEraParser:

Public Member Functions

 __construct (ParserOptions $options)
 

Public Attributes

const FORMAT_NAME = 'mw-era'
 
const MESSAGE_KEY = 'wikibase-time-precision-BCE'
 

Protected Member Functions

 stringParse ( $value)
 

Private Member Functions

 parseEra ( $value, Language $language)
 Try to parse era from the value in the given language.
 
 getRegexpFromMessageText ( $msgText)
 Transform the message to a pattern we can match era against.
 

Private Attributes

 $lang
 

Detailed Description

Class to parse localized era from values.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Parsers\MwEraParser::__construct ( ParserOptions  $options)

Member Function Documentation

◆ getRegexpFromMessageText()

Wikibase\Repo\Parsers\MwEraParser::getRegexpFromMessageText (   $msgText)
private

Transform the message to a pattern we can match era against.

Parameters
$msgTextstring
Returns
string

◆ parseEra()

Wikibase\Repo\Parsers\MwEraParser::parseEra (   $value,
Language  $language 
)
private

Try to parse era from the value in the given language.

Parameters
string$value
Language$language
Returns
string[]|null

◆ stringParse()

Wikibase\Repo\Parsers\MwEraParser::stringParse (   $value)
protected
Parameters
string$value
Exceptions
ParseException
Returns
string[] Array of the parsed era constant and the value with the era stripped.

Member Data Documentation

◆ $lang

Wikibase\Repo\Parsers\MwEraParser::$lang
private

◆ FORMAT_NAME

const Wikibase\Repo\Parsers\MwEraParser::FORMAT_NAME = 'mw-era'

◆ MESSAGE_KEY

const Wikibase\Repo\Parsers\MwEraParser::MESSAGE_KEY = 'wikibase-time-precision-BCE'

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