Factory for EntityContent objects.
More...
◆ __construct()
Wikibase\Repo\Content\EntityContentFactory::__construct |
( |
array |
$entityContentModels, |
|
|
array |
$entityHandlerFactoryCallbacks |
|
) |
| |
- Parameters
-
string[] | $entityContentModels | Entity type ID to content model ID mapping. |
callable[] | $entityHandlerFactoryCallbacks | Entity type ID to callback mapping for creating ContentHandler objects. |
◆ 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
◆ 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
◆ 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 |
The documentation for this class was generated from the following file: