Utility functions for Wikibase namespaces.
More...
Utility functions for Wikibase namespaces.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Lib\Store\EntityNamespaceLookup::__construct |
( |
array | $entityNamespaces, |
|
|
array | $entitySlots = [] ) |
- Parameters
-
int[] | $entityNamespaces | |
string[] | $entitySlots | |
◆ getEntityNamespace()
Wikibase\Lib\Store\EntityNamespaceLookup::getEntityNamespace |
( |
| $entityType | ) |
|
- Parameters
-
- Returns
- int|null The namespace ID number associated with the given entity type, or null if $entityType is not a know entity type identifier.
◆ getEntityNamespaces()
Wikibase\Lib\Store\EntityNamespaceLookup::getEntityNamespaces |
( |
| ) |
|
Returns a list of entity types pointing to the ids of the namespaces in which they reside.
- Returns
- int[] Array mapping entity type strings to namespace IDs
◆ getEntitySlotRole()
Wikibase\Lib\Store\EntityNamespaceLookup::getEntitySlotRole |
( |
| $entityType | ) |
|
- Parameters
-
- Returns
- string The role name of the slot that this kind of entity is stored in. In dedicated entity namespaces, this will be the "main" slot, but other slots may be used when entities are "attached" to other kinds of pages.
◆ getEntitySlots()
Wikibase\Lib\Store\EntityNamespaceLookup::getEntitySlots |
( |
| ) |
|
◆ getEntityType()
Wikibase\Lib\Store\EntityNamespaceLookup::getEntityType |
( |
| $ns | ) |
|
- Parameters
-
- Returns
- string|null
◆ isEntityNamespace()
Wikibase\Lib\Store\EntityNamespaceLookup::isEntityNamespace |
( |
| $ns | ) |
|
Determines whether the given namespace is reserved for holding some kind of Wikibase entity.
Note that this will return only if the namespace contains entities in the page's main slots. When other slots are used to "attach" entities to other kind of content, this returns false.
- See also
- isNamespaceWithEntities()
- Parameters
-
- Returns
- bool true if $ns is an entity namespace
◆ isNamespaceWithEntities()
Wikibase\Lib\Store\EntityNamespaceLookup::isNamespaceWithEntities |
( |
| $ns | ) |
|
Determines whether the given namespace contains some kind of Wikibase entity.
This will return true if pages in this namespace may contain entities in any slot.
- See also
- isEntityNamespace()
- Parameters
-
- Returns
- bool true if $ns is an entity namespace
◆ merge()
- Parameters
-
EntityNamespaceLookup | $nsLookup | |
- Returns
- EntityNamespaceLookup
◆ $entityNamespaces
Wikibase\Lib\Store\EntityNamespaceLookup::$entityNamespaces |
|
private |
◆ $entitySlots
Wikibase\Lib\Store\EntityNamespaceLookup::$entitySlots |
|
private |
The documentation for this class was generated from the following file: