MediaWiki master
MediaWiki\Content\ContentHandlerFactory Class Reference

Inherits MediaWiki\Content\IContentHandlerFactory.

Collaboration diagram for MediaWiki\Content\ContentHandlerFactory:

Public Member Functions

 __construct (array $handlerSpecs, ObjectFactory $objectFactory, HookContainer $hookContainer, LoggerInterface $logger)
 
 defineContentHandler (string $modelID, $handlerSpec)
 Define HandlerSpec for ModelID.
 
 getAllContentFormats ()
 
 getContentHandler (string $modelID)
 
 getContentModels ()
 Get defined ModelIDs.
 
 isDefinedModel (string $modelID)
 

Detailed Description

Definition at line 41 of file ContentHandlerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Content\ContentHandlerFactory::__construct ( array $handlerSpecs,
ObjectFactory $objectFactory,
HookContainer $hookContainer,
LoggerInterface $logger )
Since
1.35
Access: internal
Use
See also
MediaWikiServices::getContentHandlerFactory
Parameters
string[] | callable[]$handlerSpecsAn associative array mapping each known content model to the ObjectFactory spec used to construct its ContentHandler. This array typically comes from $wgContentHandlers.
ObjectFactory$objectFactory
HookContainer$hookContainer
LoggerInterface$logger

Definition at line 73 of file ContentHandlerFactory.php.

Member Function Documentation

◆ defineContentHandler()

MediaWiki\Content\ContentHandlerFactory::defineContentHandler ( string $modelID,
$handlerSpec )

Define HandlerSpec for ModelID.

Parameters
string$modelID
callable | string$handlerSpec
Access: internal

Definition at line 112 of file ContentHandlerFactory.php.

◆ getAllContentFormats()

MediaWiki\Content\ContentHandlerFactory::getAllContentFormats ( )
Returns
string[]

Implements MediaWiki\Content\IContentHandlerFactory.

Definition at line 145 of file ContentHandlerFactory.php.

◆ getContentHandler()

MediaWiki\Content\ContentHandlerFactory::getContentHandler ( string $modelID)
Parameters
string$modelID
Returns
ContentHandler
Exceptions
MWUnknownContentModelExceptionIf no handler is known for the model ID.

Implements MediaWiki\Content\IContentHandlerFactory.

Definition at line 91 of file ContentHandlerFactory.php.

◆ getContentModels()

MediaWiki\Content\ContentHandlerFactory::getContentModels ( )

Get defined ModelIDs.

Returns
string[]

Implements MediaWiki\Content\IContentHandlerFactory.

Definition at line 127 of file ContentHandlerFactory.php.

◆ isDefinedModel()

MediaWiki\Content\ContentHandlerFactory::isDefinedModel ( string $modelID)
Parameters
string$modelID
Returns
bool

Implements MediaWiki\Content\IContentHandlerFactory.

Definition at line 161 of file ContentHandlerFactory.php.


The documentation for this class was generated from the following file: