Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Content\ItemHandler Class Reference

Content handler for Wikibase items. More...

+ Inheritance diagram for Wikibase\Repo\Content\ItemHandler:
+ Collaboration diagram for Wikibase\Repo\Content\ItemHandler:

Public Member Functions

 __construct (EntityTermStoreWriter $entityTermStoreWriter, EntityContentDataCodec $contentCodec, EntityConstraintProvider $constraintProvider, ValidatorErrorLocalizer $errorLocalizer, EntityIdParser $entityIdParser, SiteLinkStore $siteLinkStore, BagOStuffSiteLinkConflictLookup $bagOStuffSiteLinkConflictLookup, EntityIdLookup $entityIdLookup, FallbackLabelDescriptionLookupFactory $labelLookupFactory, FieldDefinitions $itemFieldDefinitions, PropertyDataTypeLookup $dataTypeLookup, RepoDomainDb $db, ?callable $legacyExportFormatDetector=null)
 
 getActionOverrides ()
 
 getSpecialPageForCreation ()
 
 getEntityType ()
 Returns Item::ENTITY_TYPE.
 
 getDeletionUpdates (Title $title, $role)
 
 makeEmptyEntity ()
 
 makeEntityRedirectContent (EntityRedirect $redirect)
 
 supportsRedirects ()
 
 makeEntityId ( $id)
 
 getIdentifiersCount (StatementList $statementList)
 
- Public Member Functions inherited from Wikibase\Repo\Content\EntityHandler
 __construct ( $modelId, $unused, EntityContentDataCodec $contentCodec, EntityConstraintProvider $constraintProvider, ValidatorErrorLocalizer $errorLocalizer, EntityIdParser $entityIdParser, FieldDefinitions $fieldDefinitions, $legacyExportFormatDetector=null)
 
 getLegacyExportFormatDetector ()
 Returns the callback used to determine whether a serialized blob needs to be re-serialized on export (or null of re-serialization is disabled).
 
 showMissingEntity (Title $title, IContextSource $context)
 Handle the fact that a given page does not contain an Entity, even though it could.
 
 getOnSaveValidators ( $forCreation, EntityId $entityId)
 Get EntityValidators for on-save validation.
 
 getValidationErrorLocalizer ()
 Error localizer for use together with getOnSaveValidators().
 
 makeEmptyContent ()
 
 supportsCategories ()
 None of the Entity content models support categories.
 
 generateHTMLOnEdit ()
 Do not render HTML on edit (T285987)
 
 getAutosummary (Content $oldContent=null, Content $newContent=null, $flags=0)
 
 makeRedirectContent (Title $title, $text='')
 
 exportTransform ( $blob, $format=null)
 
 makeEntityContent (EntityHolder $entityHolder)
 
 getDefaultFormat ()
 
 serializeContent (Content $content, $format=null)
 
 unserializeContent ( $blob, $format=null)
 
 getIdForTitle (Title $target)
 Returns the ID of the entity contained by the page of the given title.
 
 getTitleForId (EntityId $id)
 Returns the appropriate page Title for the given EntityId.
 
 getTitlesForIds (array $ids)
 Returns the appropriate page Titles for the given EntityIds.
 
 getEntityNamespace ()
 Returns the namespace that is to be used for this kind of entities.
 
 getEntitySlotRole ()
 Returns the slot that is to be used for this kind of entities.
 
 canBeUsedOn (Title $title)
 
 isParserCacheSupported ()
 Returns true to indicate that the parser cache can be used for data items.
 
 getPageViewLanguage (Title $title, Content $content=null)
 
 getPageLanguage (Title $title, Content $content=null)
 
 getUndoContent (Content $latestContent, Content $newerContent, Content $olderContent, $undoIsLatest=false)
 
 allowAutomaticIds ()
 Whether IDs can automatically be assigned to entities of the kind supported by this EntityHandler.
 
 canCreateWithCustomId (EntityId $id)
 Whether the given custom ID is valid for creating a new entity of the kind supported by this EntityHandler.
 
 getFieldsForSearchIndex (SearchEngine $engine)
 
 getDataForSearchIndex (WikiPage $page, ParserOutput $parserOutput, SearchEngine $engine, RevisionRecord $revision=null)
 
 getContentDataForSearchIndex (Content $content)
 Extract fields data for the search index but only the fields related to the slot content.
 
 getParserOutputForIndexing (WikiPage $page, ParserCache $cache=null, RevisionRecord $revision=null)
 Produce page output suitable for indexing.
 
 validateSave (Content $content, ValidationParams $validationParams)
 

Protected Member Functions

 newEntityContent (EntityHolder $entityHolder=null)
 
 getParserOutputFromEntityView (EntityContent $content, $revisionId, ParserOptions $options, $generateHtml=true)
 
Note
Will fail if this EntityContent represents a redirect.
Parameters
EntityContent$content
int | null$revisionId
ParserOptions$options
bool$generateHtml
Returns
ParserOutput

 
- Protected Member Functions inherited from Wikibase\Repo\Content\EntityHandler
 getDiffEngineClass ()
 
 getSlotDiffRendererWithOptions (IContextSource $context, $options=[])
 
 fillParserOutput (Content $content, ContentParseParams $cpoParams, ParserOutput &$parserOutput)
 
 getParserOutputForRedirect (EntityContent $content, bool $generateHtml)
 

Private Attributes

 $siteLinkStore
 
 $bagOStuffSiteLinkConflictLookup
 
 $entityIdLookup
 
 $labelLookupFactory
 
 $dataTypeLookup
 
 $entityTermStoreWriter
 
 $db
 
 $isExternalIdByPropertyId
 

Additional Inherited Members

- Public Attributes inherited from Wikibase\Repo\Content\EntityHandler
const PARSER_VERSION = 3
 Added to parser options for EntityContent.
 
- Protected Attributes inherited from Wikibase\Repo\Content\EntityHandler
 $fieldDefinitions
 
 $contentCodec
 
 $constraintProvider
 

Detailed Description

Content handler for Wikibase items.

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Daniel Kinzler
Adrian Heine adria.nosp@m.n.he.nosp@m.ine@w.nosp@m.ikim.nosp@m.edia..nosp@m.de

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Content\ItemHandler::__construct ( EntityTermStoreWriter $entityTermStoreWriter,
EntityContentDataCodec $contentCodec,
EntityConstraintProvider $constraintProvider,
ValidatorErrorLocalizer $errorLocalizer,
EntityIdParser $entityIdParser,
SiteLinkStore $siteLinkStore,
BagOStuffSiteLinkConflictLookup $bagOStuffSiteLinkConflictLookup,
EntityIdLookup $entityIdLookup,
FallbackLabelDescriptionLookupFactory $labelLookupFactory,
FieldDefinitions $itemFieldDefinitions,
PropertyDataTypeLookup $dataTypeLookup,
RepoDomainDb $db,
?callable $legacyExportFormatDetector = null )

Member Function Documentation

◆ getActionOverrides()

Wikibase\Repo\Content\ItemHandler::getActionOverrides ( )

◆ getDeletionUpdates()

Wikibase\Repo\Content\ItemHandler::getDeletionUpdates ( Title $title,
$role )

◆ getEntityType()

Wikibase\Repo\Content\ItemHandler::getEntityType ( )

Returns Item::ENTITY_TYPE.

Returns
string

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ getIdentifiersCount()

Wikibase\Repo\Content\ItemHandler::getIdentifiersCount ( StatementList $statementList)
Parameters
StatementList$statementList
Returns
int

◆ getParserOutputFromEntityView()

Wikibase\Repo\Content\ItemHandler::getParserOutputFromEntityView ( EntityContent $content,
$revisionId,
ParserOptions $options,
$generateHtml = true )
protected

Note
Will fail if this EntityContent represents a redirect.
Parameters
EntityContent$content
int | null$revisionId
ParserOptions$options
bool$generateHtml
Returns
ParserOutput

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ getSpecialPageForCreation()

Wikibase\Repo\Content\ItemHandler::getSpecialPageForCreation ( )
See also
EntityHandler::getSpecialPageForCreation
Returns
string

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ makeEmptyEntity()

Wikibase\Repo\Content\ItemHandler::makeEmptyEntity ( )
See also
EntityHandler::makeEmptyEntity()
Returns
EntityDocument

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ makeEntityId()

Wikibase\Repo\Content\ItemHandler::makeEntityId ( $id)
See also
EntityContent::makeEntityId
Parameters
string$id
Returns
EntityId

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ makeEntityRedirectContent()

Wikibase\Repo\Content\ItemHandler::makeEntityRedirectContent ( EntityRedirect $redirect)
See also
EntityHandler::makeEntityRedirectContent
Parameters
EntityRedirect$redirect
Returns
ItemContent

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ newEntityContent()

Wikibase\Repo\Content\ItemHandler::newEntityContent ( EntityHolder $entityHolder = null)
protected
See also
EntityHandler::newEntityContent
Parameters
EntityHolder | null$entityHolder
Returns
ItemContent

Reimplemented from Wikibase\Repo\Content\EntityHandler.

◆ supportsRedirects()

Wikibase\Repo\Content\ItemHandler::supportsRedirects ( )
See also
EntityHandler::supportsRedirects
Returns
bool Always true.

Member Data Documentation

◆ $bagOStuffSiteLinkConflictLookup

Wikibase\Repo\Content\ItemHandler::$bagOStuffSiteLinkConflictLookup
private

◆ $dataTypeLookup

Wikibase\Repo\Content\ItemHandler::$dataTypeLookup
private

◆ $db

Wikibase\Repo\Content\ItemHandler::$db
private

◆ $entityIdLookup

Wikibase\Repo\Content\ItemHandler::$entityIdLookup
private

◆ $entityTermStoreWriter

Wikibase\Repo\Content\ItemHandler::$entityTermStoreWriter
private

◆ $isExternalIdByPropertyId

Wikibase\Repo\Content\ItemHandler::$isExternalIdByPropertyId
private

◆ $labelLookupFactory

Wikibase\Repo\Content\ItemHandler::$labelLookupFactory
private

◆ $siteLinkStore

Wikibase\Repo\Content\ItemHandler::$siteLinkStore
private

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