Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Api\ApiHelperFactory Class Reference

A factory class for API helper objects. More...

Public Member Functions

 __construct (EntityTitleLookup $titleLookup, ExceptionLocalizer $exceptionLocalizer, PropertyDataTypeLookup $dataTypeLookup, SiteLookup $siteLookup, SummaryFormatter $summaryFormatter, EntityRevisionLookup $entityRevisionLookup, MediawikiEditEntityFactory $editEntityFactory, SerializerFactory $serializerFactory, Serializer $entitySerializer, EntityIdParser $idParser, PermissionManager $permissionManager, EntityByLinkedTitleLookup $entityByLinkedTitleLookup=null, EntityFactory $entityFactory=null, EntityStore $entityStore=null)
 
 getResultBuilder (ApiBase $api)
 Returns a ResultBuilder wrapping the ApiResult of the given API module.
 
 getErrorReporter (ApiBase $api)
 Returns an ApiErrorReporter suitable for reporting errors from the given API module.
 
 getEntitySavingHelper (ApiBase $apiBase)
 Return an EntitySavingHelper object for use in Api modules.
 
 getEntityLoadingHelper (ApiBase $apiBase)
 Return an EntityLoadingHelper object for use in Api modules.
 

Private Attributes

 $titleLookup
 
 $exceptionLocalizer
 
 $dataTypeLookup
 
 $summaryFormatter
 
 $entityRevisionLookup
 
 $editEntityFactory
 
 $siteLookup
 
 $serializerFactory
 
 $entitySerializer
 
 $idParser
 
 $permissionManager
 
 $entityByLinkedTitleLookup
 
 $entityFactory
 
 $entityStore
 

Detailed Description

A factory class for API helper objects.

Note
: This is a high level factory which should not be injected or passed around. It should only be used when bootstrapping from a static context.
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\ApiHelperFactory::__construct ( EntityTitleLookup  $titleLookup,
ExceptionLocalizer  $exceptionLocalizer,
PropertyDataTypeLookup  $dataTypeLookup,
SiteLookup  $siteLookup,
SummaryFormatter  $summaryFormatter,
EntityRevisionLookup  $entityRevisionLookup,
MediawikiEditEntityFactory  $editEntityFactory,
SerializerFactory  $serializerFactory,
Serializer  $entitySerializer,
EntityIdParser  $idParser,
PermissionManager  $permissionManager,
EntityByLinkedTitleLookup  $entityByLinkedTitleLookup = null,
EntityFactory  $entityFactory = null,
EntityStore  $entityStore = null 
)
Parameters
EntityTitleLookup$titleLookup
ExceptionLocalizer$exceptionLocalizer
PropertyDataTypeLookup$dataTypeLookup
SiteLookup$siteLookup
SummaryFormatter$summaryFormatter
EntityRevisionLookup$entityRevisionLookup
MediawikiEditEntityFactory$editEntityFactory
SerializerFactory$serializerFactory
Serializer$entitySerializer
EntityIdParser$idParser
PermissionManager$permissionManager
EntityByLinkedTitleLookup | null$entityByLinkedTitleLookup
EntityFactory | null$entityFactory
EntityStore | null$entityStore

Member Function Documentation

◆ getEntityLoadingHelper()

Wikibase\Repo\Api\ApiHelperFactory::getEntityLoadingHelper ( ApiBase  $apiBase)

Return an EntityLoadingHelper object for use in Api modules.

Warning
The resulting EntityLoadingHelper may be stateful and should only be used for a single API request.
Parameters
ApiBase$apiBase
Returns
EntityLoadingHelper a new EntityLoadingHelper instance

◆ getEntitySavingHelper()

Wikibase\Repo\Api\ApiHelperFactory::getEntitySavingHelper ( ApiBase  $apiBase)

Return an EntitySavingHelper object for use in Api modules.

Warning
The resulting EntitySavingHelper may be stateful and should only be used for a single API request.
Parameters
ApiBase$apiBase
Returns
EntitySavingHelper a new EntitySavingHelper instance

◆ getErrorReporter()

Wikibase\Repo\Api\ApiHelperFactory::getErrorReporter ( ApiBase  $api)

Returns an ApiErrorReporter suitable for reporting errors from the given API module.

Parameters
ApiBase$api
Returns
ApiErrorReporter

◆ getResultBuilder()

Wikibase\Repo\Api\ApiHelperFactory::getResultBuilder ( ApiBase  $api)

Returns a ResultBuilder wrapping the ApiResult of the given API module.

Parameters
ApiBase$api
Returns
ResultBuilder

Member Data Documentation

◆ $dataTypeLookup

Wikibase\Repo\Api\ApiHelperFactory::$dataTypeLookup
private

◆ $editEntityFactory

Wikibase\Repo\Api\ApiHelperFactory::$editEntityFactory
private

◆ $entityByLinkedTitleLookup

Wikibase\Repo\Api\ApiHelperFactory::$entityByLinkedTitleLookup
private

◆ $entityFactory

Wikibase\Repo\Api\ApiHelperFactory::$entityFactory
private

◆ $entityRevisionLookup

Wikibase\Repo\Api\ApiHelperFactory::$entityRevisionLookup
private

◆ $entitySerializer

Wikibase\Repo\Api\ApiHelperFactory::$entitySerializer
private

◆ $entityStore

Wikibase\Repo\Api\ApiHelperFactory::$entityStore
private

◆ $exceptionLocalizer

Wikibase\Repo\Api\ApiHelperFactory::$exceptionLocalizer
private

◆ $idParser

Wikibase\Repo\Api\ApiHelperFactory::$idParser
private

◆ $permissionManager

Wikibase\Repo\Api\ApiHelperFactory::$permissionManager
private

◆ $serializerFactory

Wikibase\Repo\Api\ApiHelperFactory::$serializerFactory
private

◆ $siteLookup

Wikibase\Repo\Api\ApiHelperFactory::$siteLookup
private

◆ $summaryFormatter

Wikibase\Repo\Api\ApiHelperFactory::$summaryFormatter
private

◆ $titleLookup

Wikibase\Repo\Api\ApiHelperFactory::$titleLookup
private

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