MediaWiki master
|
Helper for TempUserConfig representing string patterns with "$1" indicating variable substitution. More...
Inherits Stringable.
Public Member Functions | |
__construct (string $debugName, string $pattern) | |
__toString () | |
buildLike (ISQLPlatform $db) | |
Convert the pattern to an SQL like clause. | |
extract (string $name) | |
Extract the variable part of the string (matching $1 or YYYY-$1), or null if there is no match. | |
generate ( $mappedSerial, ?string $year=null) | |
Substitute the serial number into the pattern. | |
isMatch (string $name) | |
Does the pattern match the given name? | |
toLikeValue (ISQLPlatform $db) | |
Convert the pattern to an SQL builder "LIKE" value that matches it. | |
Helper for TempUserConfig representing string patterns with "$1" indicating variable substitution.
Definition at line 16 of file Pattern.php.
MediaWiki\User\TempUser\Pattern::__construct | ( | string | $debugName, |
string | $pattern ) |
string | $debugName | The name of the pattern, for use in error messages |
string | $pattern | The pattern itself |
Definition at line 30 of file Pattern.php.
MediaWiki\User\TempUser\Pattern::__toString | ( | ) |
Definition at line 131 of file Pattern.php.
MediaWiki\User\TempUser\Pattern::buildLike | ( | ISQLPlatform | $db | ) |
Convert the pattern to an SQL like clause.
ISQLPlatform | $db |
Definition at line 75 of file Pattern.php.
References Wikimedia\Rdbms\Platform\ISQLPlatform\anyString(), Wikimedia\Rdbms\Platform\ISQLPlatform\buildLike(), and wfDeprecated().
MediaWiki\User\TempUser\Pattern::extract | ( | string | $name | ) |
Extract the variable part of the string (matching $1 or YYYY-$1), or null if there is no match.
string | $name |
Definition at line 107 of file Pattern.php.
MediaWiki\User\TempUser\Pattern::generate | ( | $mappedSerial, | |
?string | $year = null ) |
Substitute the serial number into the pattern.
string | $mappedSerial | |
?string | $year |
Definition at line 60 of file Pattern.php.
MediaWiki\User\TempUser\Pattern::isMatch | ( | string | $name | ) |
Does the pattern match the given name?
string | $name |
Definition at line 40 of file Pattern.php.
MediaWiki\User\TempUser\Pattern::toLikeValue | ( | ISQLPlatform | $db | ) |
Convert the pattern to an SQL builder "LIKE" value that matches it.
ISQLPlatform | $db |
Definition at line 91 of file Pattern.php.