MediaWiki REL1_39
MediaWiki\Content\Hook\ConvertContentHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Content\Hook\ConvertContentHook:

Public Member Functions

 onConvertContent ( $content, $toModel, $lossy, &$result)
 This hook is called by AbstractContent::convert when a conversion to another content model is requested.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ConvertContent" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 14 of file ConvertContentHook.php.

Member Function Documentation

◆ onConvertContent()

MediaWiki\Content\Hook\ConvertContentHook::onConvertContent ( $content,
$toModel,
$lossy,
& $result )

This hook is called by AbstractContent::convert when a conversion to another content model is requested.

Handler functions that modify $result should generally return false to disable further attempts at conversion.

Since
1.35
Parameters
Content$contentContent object to be converted
string$toModelID of the content model to convert to
bool$lossyWhether lossy conversion is allowed
Content | bool&$resultOutput parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel.
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


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