Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / content / Hook / ConvertContentHook.php
blob2f026a8d4a2e4f331d2f0ef2a2c59b73a097a090
1 <?php
3 namespace MediaWiki\Content\Hook;
5 use MediaWiki\Content\Content;
7 /**
8 * This is a hook handler interface, see docs/Hooks.md.
9 * Use the hook name "ConvertContent" to register handlers implementing this interface.
11 * @stable to implement
12 * @ingroup Hooks
14 interface ConvertContentHook {
15 /**
16 * This hook is called by AbstractContent::convert when a conversion to another content model
17 * is requested. Handler functions that modify $result should generally return false to disable
18 * further attempts at conversion.
20 * @since 1.35
22 * @param Content $content Content object to be converted
23 * @param string $toModel ID of the content model to convert to
24 * @param bool $lossy Whether lossy conversion is allowed
25 * @param Content|false &$result Output parameter, in case the handler function wants to
26 * provide a converted Content object. Note that $result->getContentModel() must return
27 * $toModel.
28 * @return bool|void True or no return value to continue or false to abort
30 public function onConvertContent( $content, $toModel, $lossy, &$result );