Class to parse localized era from values.
More...
|
| parseEra ( $value, Language $language) |
| Try to parse era from the value in the given language.
|
|
| parseEraWithMessage (string $value, string $msgText) |
| Try to parse the era from the value using the given message text.
|
|
| getRegexpFromMessageText ( $msgText) |
| Transform the message to a pattern we can match era against.
|
|
Class to parse localized era from values.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Repo\Parsers\MwEraParser::__construct |
( |
ParserOptions | $options | ) |
|
◆ getRegexpFromMessageText()
Wikibase\Repo\Parsers\MwEraParser::getRegexpFromMessageText |
( |
| $msgText | ) |
|
|
private |
Transform the message to a pattern we can match era against.
- Parameters
-
- 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
◆ parseEraWithMessage()
Wikibase\Repo\Parsers\MwEraParser::parseEraWithMessage |
( |
string | $value, |
|
|
string | $msgText ) |
|
private |
Try to parse the era from the value using the given message text.
- Parameters
-
string | $value | |
string | $msgText | |
- Returns
- string|null The value with the era stripped (if it can be parsed).
◆ stringParse()
Wikibase\Repo\Parsers\MwEraParser::stringParse |
( |
| $value | ) |
|
|
protected |
- Parameters
-
- Exceptions
-
- Returns
- string[] Array of the parsed era constant and the value with the era stripped.
◆ $lang
Wikibase\Repo\Parsers\MwEraParser::$lang |
|
private |
◆ BCE_MESSAGE_KEY
const Wikibase\Repo\Parsers\MwEraParser::BCE_MESSAGE_KEY = 'wikibase-time-precision-BCE' |
◆ CE_MESSAGE_KEY
const Wikibase\Repo\Parsers\MwEraParser::CE_MESSAGE_KEY = 'wikibase-time-precision-CE' |
◆ FORMAT_NAME
const Wikibase\Repo\Parsers\MwEraParser::FORMAT_NAME = 'mw-era' |
The documentation for this class was generated from the following file: