3 namespace MediaWiki\Content
;
5 use MWUnknownContentModelException
;
7 interface IContentHandlerFactory
{
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
;
20 * Returns a list of defined content models.
21 * getContentHandler() can be expected to return a ContentHandler for the models returned
26 public function getContentModels(): array;
29 * Returns a list of all serialization formats supported for any of the defined content models.
30 * @see ContentHandler::getSupportedFormats()
33 public function getAllContentFormats(): array;
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
42 public function isDefinedModel( string $modelID ): bool;