Wikibase
MediaWiki Wikibase extension
|
Value object representing the usage of an entity. More...
Public Member Functions | |
__construct (EntityId $entityId, $aspect, $modifier=null) | |
getAspect () | |
getModifier () | |
getAspectKey () | |
Returns the aspect with the modifier applied. More... | |
getEntityId () | |
getIdentityString () | |
__toString () | |
asArray () | |
Static Public Member Functions | |
static | stripModifier ( $aspectKey) |
static | splitAspectKey ( $aspectKey) |
Splits the given aspect key into aspect and modifier (if any). More... | |
static | makeAspectKey ( $aspect, $modifier=null) |
Composes an aspect key from aspect and modifier (if any). More... | |
Public Attributes | |
const | SITELINK_USAGE = 'S' |
Usage flag indicating that the entity's sitelinks were used as links. More... | |
const | LABEL_USAGE = 'L' |
Usage flag indicating that one of the entity's labels were used. More... | |
const | DESCRIPTION_USAGE = 'D' |
Usage flag indicating that one of the entity's descriptions were used. More... | |
const | TITLE_USAGE = 'T' |
Usage flag indicating that the entity's local page name was used, i.e. More... | |
const | STATEMENT_USAGE = 'C' |
Usage flag indicating that certain statements (identified by their property id) from the entity were used. More... | |
const | ALL_USAGE = 'X' |
Usage flag indicating that any and all aspects of the entity were (or may have been) used. More... | |
const | OTHER_USAGE = 'O' |
Usage flag indicating that some aspect of the entity was changed which is not covered by any other usage flag (except "all"). More... | |
Private Attributes | |
$entityId | |
$aspect | |
$modifier | |
$identity | |
Static Private Attributes | |
static | $aspects |
Value object representing the usage of an entity.
This includes information about how the entity is used, but not where.
Wikibase\Client\Usage\EntityUsage::__construct | ( | EntityId | $entityId, |
$aspect, | |||
$modifier = null |
|||
) |
EntityId | $entityId | |
string | $aspect | use the EntityUsage::XXX_USAGE constants |
string | null | $modifier | for further qualifying the usage aspect (e.g. a language code may be used along with the LABEL_USAGE aspect. |
InvalidArgumentException |
Wikibase\Client\Usage\EntityUsage::__toString | ( | ) |
Wikibase\Client\Usage\EntityUsage::asArray | ( | ) |
Wikibase\Client\Usage\EntityUsage::getAspect | ( | ) |
Wikibase\Client\Usage\EntityUsage::getAspectKey | ( | ) |
Wikibase\Client\Usage\EntityUsage::getEntityId | ( | ) |
Wikibase\Client\Usage\EntityUsage::getIdentityString | ( | ) |
Wikibase\Client\Usage\EntityUsage::getModifier | ( | ) |
|
static |
Composes an aspect key from aspect and modifier (if any).
This is the inverse of splitAspectKey().
string | $aspect | |
string | null | $modifier |
|
static |
Splits the given aspect key into aspect and modifier (if any).
This is the inverse of makeAspectKey().
string | $aspectKey |
|
static |
string | $aspectKey |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
const Wikibase\Client\Usage\EntityUsage::ALL_USAGE = 'X' |
Usage flag indicating that any and all aspects of the entity were (or may have been) used.
const Wikibase\Client\Usage\EntityUsage::DESCRIPTION_USAGE = 'D' |
Usage flag indicating that one of the entity's descriptions were used.
This would be the case when showing the descriptions of a referenced entity. Note that descriptions usage is typically tracked with a modifier specifying the language code.
const Wikibase\Client\Usage\EntityUsage::LABEL_USAGE = 'L' |
Usage flag indicating that one of the entity's labels were used.
This would be the case when showing the label of a referenced entity. Note that label usage is typically tracked with a modifier specifying the label's language code.
const Wikibase\Client\Usage\EntityUsage::OTHER_USAGE = 'O' |
Usage flag indicating that some aspect of the entity was changed which is not covered by any other usage flag (except "all").
That is, the specific usage flags together with the "other" flag are equivalent to the "all" flag ( S + T + L + O = X or rather O = X - S - T - L ).
This currently covers alias usage and entity existence checks.
const Wikibase\Client\Usage\EntityUsage::SITELINK_USAGE = 'S' |
Usage flag indicating that the entity's sitelinks were used as links.
This would be the case when generating language links or sister links from an entity's sitelinks, for display in the sidebar.
const Wikibase\Client\Usage\EntityUsage::STATEMENT_USAGE = 'C' |
Usage flag indicating that certain statements (identified by their property id) from the entity were used.
This currently implies that we also have an OTHER_USAGE or an ALL_USAGE for the same entity (STATEMENT_USAGE is never used alone).
const Wikibase\Client\Usage\EntityUsage::TITLE_USAGE = 'T' |
Usage flag indicating that the entity's local page name was used, i.e.
the title of the local (client) page linked to the entity. This would be the case when linking a referenced entity to the corresponding local wiki page. This can be thought of as a special kind of sitelink usage, specifically for the sitelink for the local wiki.