Manual:Hooks/Collation::factory

Collation::factory
Available from version 1.18.0 (r91436)
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": "MyExtensionHooks::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.

DetailsEdit

  • $vollationName: 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.

NotesEdit

  • $collationObj must be a subclass of the Collation class in order to be used.