Manual:Hooks/Collation::factory
Appearance
Collation::factory | |
---|---|
Available from version 1.18.0 (r91436, CodeReview archive) Called if Collation::factory cannot find what class implements a collation. | |
Define function: | public static function onCollation_factory( $categoryName, &$categoryObj ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"Collation::factory": "MediaWiki\\Extension\\MyExtension\\Hooks::onCollationfactory"
}
}
|
Called from: | File(s): collation/Collation.php |
Interface: | Collation__factoryHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:Collation::factory extensions.
Details
[edit]- $collationName: A (string) name of the collation requested. What would go in $wgCategoryCollation
- &$collationObj: Replace this with an instance of a Collation class that corresponds to $collationName, if your extension supports the collation given in $collationName.
Notes
[edit]- $collationObj must be a subclass of the Collation class in order to be used.