MWUnknownContentModelException.php 827 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Exception thrown when an unregistered content model is requested. This error
  4. * can be triggered by user input, so a separate exception class is provided so
  5. * callers can substitute a context-specific, internationalised error message.
  6. *
  7. * @ingroup Content
  8. * @since 1.27
  9. */
  10. class MWUnknownContentModelException extends MWException {
  11. /** @var string The name of the unknown content model */
  12. private $modelId;
  13. /** @param string $modelId */
  14. function __construct( $modelId ) {
  15. parent::__construct( "The content model '$modelId' is not registered on this wiki.\n" .
  16. 'See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions ' .
  17. 'handle this content model.' );
  18. $this->modelId = $modelId;
  19. }
  20. /** @return string */
  21. public function getModelId() {
  22. return $this->modelId;
  23. }
  24. }