Factory for EntityContent objects.
More...
◆ __construct()
Wikibase\Repo\Content\EntityContentFactory::__construct |
( |
array |
$entityContentModels, |
|
|
array |
$entityHandlerFactoryCallbacks, |
|
|
EntitySourceDefinitions |
$entitySourceDefinitions, |
|
|
EntitySource |
$localEntitySource, |
|
|
InterwikiLookup |
$interwikiLookup = null |
|
) |
| |
- Parameters
-
string[] | $entityContentModels | Entity type ID to content model ID mapping. |
callable[] | $entityHandlerFactoryCallbacks | Entity type ID to callback mapping for creating ContentHandler objects. |
EntitySourceDefinitions | $entitySourceDefinitions | |
EntitySource | $localEntitySource | |
InterwikiLookup | null | $interwikiLookup | |
◆ entityNotFromLocalEntitySource()
Wikibase\Repo\Content\EntityContentFactory::entityNotFromLocalEntitySource |
( |
EntityId |
$id | ) |
|
|
private |
◆ getContentHandlerForType()
Wikibase\Repo\Content\EntityContentFactory::getContentHandlerForType |
( |
string |
$entityType | ) |
|
Returns the EntityHandler for the given entity type.
- Parameters
-
- Exceptions
-
OutOfBoundsException | if no content model is defined for the given entity type. |
- Returns
- EntityHandler
◆ getContentModelForType()
Wikibase\Repo\Content\EntityContentFactory::getContentModelForType |
( |
string |
$entityType | ) |
|
Determines what content model is suitable for the given type of entities.
- Parameters
-
- Exceptions
-
OutOfBoundsException | if no content model is defined for the given entity type. |
- Returns
- string
◆ getEntityContentModels()
Wikibase\Repo\Content\EntityContentFactory::getEntityContentModels |
( |
| ) |
|
- Returns
- string[] A list of content model IDs used to represent Wikibase entities.
◆ getEntityHandlerForContentModel()
Wikibase\Repo\Content\EntityContentFactory::getEntityHandlerForContentModel |
( |
string |
$contentModel | ) |
|
Returns the EntityHandler for the given model id.
- Parameters
-
- Exceptions
-
OutOfBoundsException | if no entity handler is defined for the given content model. |
- Returns
- EntityHandler
◆ getEntityIdForTitle()
Wikibase\Repo\Content\EntityContentFactory::getEntityIdForTitle |
( |
Title |
$title | ) |
|
Returns the ID of the entity associated with the given page title.
- Note
- There is no guarantee that the EntityId returned by this method refers to an existing entity.
- Parameters
-
- Returns
- EntityId|null
Implements Wikibase\Lib\Store\EntityIdLookup.
◆ getEntityIds()
Wikibase\Repo\Content\EntityContentFactory::getEntityIds |
( |
array |
$titles | ) |
|
◆ getEntityTypes()
Wikibase\Repo\Content\EntityContentFactory::getEntityTypes |
( |
| ) |
|
- Returns
- string[] A list of entity type IDs used for Wikibase entities.
◆ getNamespaceForType()
Wikibase\Repo\Content\EntityContentFactory::getNamespaceForType |
( |
string |
$entityType | ) |
|
Determines what namespace is suitable for the given type of entities.
- Parameters
-
- Exceptions
-
OutOfBoundsException | if no content model is defined for the given entity type. |
- Returns
- int
◆ getSlotRoleForType()
Wikibase\Repo\Content\EntityContentFactory::getSlotRoleForType |
( |
string |
$entityType | ) |
|
Determines which slot is used to store a given type of entities.
- Parameters
-
- Exceptions
-
OutOfBoundsException | if no content model is defined for the given entity type. |
- Returns
- string the role name of the slot
◆ getTitleForFederatedId()
Wikibase\Repo\Content\EntityContentFactory::getTitleForFederatedId |
( |
EntityId |
$id | ) |
|
|
private |
If the EntityId is federated, return a Title for it.
Otherwise return null
- Parameters
-
- Returns
- null|Title
◆ getTitleForId()
Wikibase\Repo\Content\EntityContentFactory::getTitleForId |
( |
EntityId |
$id | ) |
|
Returns the Title object for the item with provided id.
- Parameters
-
- Exceptions
-
MWException | |
OutOfBoundsException | |
InvalidArgumentException | |
- Returns
- Title|null
Implements Wikibase\Lib\Store\EntityTitleLookup.
◆ getTitlesForIds()
Wikibase\Repo\Content\EntityContentFactory::getTitlesForIds |
( |
array |
$ids | ) |
|
Returns Title objects for the entities with provided ids.
- Parameters
-
- Exceptions
-
MWException | |
OutOfBoundsException | |
InvalidArgumentException | |
- Returns
- (Title|null)[]
Implements Wikibase\Lib\Store\EntityTitleLookup.
◆ isEntityContentModel()
Wikibase\Repo\Content\EntityContentFactory::isEntityContentModel |
( |
string |
$contentModel | ) |
|
Determines whether the given content model is designated to hold some kind of Wikibase entity.
- Parameters
-
- Returns
- bool If the given content model ID is a known entity content model.
◆ newFromEntity()
Wikibase\Repo\Content\EntityContentFactory::newFromEntity |
( |
EntityDocument |
$entity | ) |
|
◆ newFromRedirect()
Wikibase\Repo\Content\EntityContentFactory::newFromRedirect |
( |
EntityRedirect |
$redirect | ) |
|
◆ $entityContentModels
Wikibase\Repo\Content\EntityContentFactory::$entityContentModels |
|
private |
◆ $entityHandlerFactoryCallbacks
Wikibase\Repo\Content\EntityContentFactory::$entityHandlerFactoryCallbacks |
|
private |
◆ $entityHandlers
Wikibase\Repo\Content\EntityContentFactory::$entityHandlers = [] |
|
private |
◆ $entitySourceDefinitions
Wikibase\Repo\Content\EntityContentFactory::$entitySourceDefinitions |
|
private |
◆ $interwikiLookup
Wikibase\Repo\Content\EntityContentFactory::$interwikiLookup |
|
private |
◆ $localEntitySource
Wikibase\Repo\Content\EntityContentFactory::$localEntitySource |
|
private |
◆ $titleForIdCache
Wikibase\Repo\Content\EntityContentFactory::$titleForIdCache |
|
private |
The documentation for this class was generated from the following file: