2016-12-24 11:58:38 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Exception thrown when an unregistered content model is requested. This error
|
|
|
|
|
* can be triggered by user input, so a separate exception class is provided so
|
|
|
|
|
* callers can substitute a context-specific, internationalised error message.
|
|
|
|
|
*
|
2020-06-29 12:13:29 +00:00
|
|
|
* @newable
|
2016-12-24 11:58:38 +00:00
|
|
|
* @ingroup Content
|
|
|
|
|
* @since 1.27
|
|
|
|
|
*/
|
|
|
|
|
class MWUnknownContentModelException extends MWException {
|
|
|
|
|
/** @var string The name of the unknown content model */
|
|
|
|
|
private $modelId;
|
|
|
|
|
|
2020-06-29 12:13:29 +00:00
|
|
|
/**
|
2020-07-13 08:53:06 +00:00
|
|
|
* @stable to call
|
2020-06-29 12:13:29 +00:00
|
|
|
* @param string $modelId
|
|
|
|
|
*/
|
2019-11-30 23:03:59 +00:00
|
|
|
public function __construct( $modelId ) {
|
2016-12-24 11:58:38 +00:00
|
|
|
parent::__construct( "The content model '$modelId' is not registered on this wiki.\n" .
|
|
|
|
|
'See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions ' .
|
|
|
|
|
'handle this content model.' );
|
|
|
|
|
$this->modelId = $modelId;
|
|
|
|
|
}
|
2019-01-15 15:04:58 +00:00
|
|
|
|
2016-12-24 11:58:38 +00:00
|
|
|
/** @return string */
|
|
|
|
|
public function getModelId() {
|
|
|
|
|
return $this->modelId;
|
|
|
|
|
}
|
|
|
|
|
}
|