Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / content / IContentHandlerFactory.php
blob876bc09c742d4960c6c6c98e452c8f411e316b3e
1 <?php
3 namespace MediaWiki\Content;
5 use MWUnknownContentModelException;
7 interface IContentHandlerFactory {
9 /**
10 * Returns a ContentHandler instance for the given $modelID.
12 * @param string $modelID
14 * @return ContentHandler
15 * @throws MWUnknownContentModelException If no handler is known for the model ID.
17 public function getContentHandler( string $modelID ): ContentHandler;
19 /**
20 * Returns a list of defined content models.
21 * getContentHandler() can be expected to return a ContentHandler for the models returned
22 * by this method.
24 * @return string[]
26 public function getContentModels(): array;
28 /**
29 * Returns a list of all serialization formats supported for any of the defined content models.
30 * @see ContentHandler::getSupportedFormats()
31 * @return string[]
33 public function getAllContentFormats(): array;
35 /**
36 * Returns true if $modelID is a defined content model for which getContentHandler() can be
37 * expected to return a ContentHandler instance.
38 * @param string $modelID
40 * @return bool
42 public function isDefinedModel( string $modelID ): bool;