Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Usage\PageEntityUsages Class Reference

Value object representing the entity usages on a single page. More...

Public Member Functions

 __construct ( $pageId, array $usages=[])
 
 getPageId ()
 Returns the page this PageEntityUsages object applies to.
 
 getUsages ()
 
 isEmpty ()
 
 addUsages (array $usages)
 
 getAspects ()
 Collects all usage aspects present on the page.
 
 getAspectKeys ()
 Collects all usage aspects present on the page.
 
 equals (self $other)
 
 getEntityIds ()
 Returns all entities used on the page represented by this PageEntityUsages object.
 
 getUsageAspectKeys (EntityId $id)
 Returns the aspects used by the given entity on the page represented by this PageEntityUsages object.
 
 __toString ()
 

Private Attributes

 $pageId
 
 $usages = []
 

Detailed Description

Value object representing the entity usages on a single page.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Usage\PageEntityUsages::__construct (   $pageId,
array  $usages = [] 
)
Parameters
int$pageId
EntityUsage[]$usages
Exceptions
InvalidArgumentException

Member Function Documentation

◆ __toString()

Wikibase\Client\Usage\PageEntityUsages::__toString ( )
Returns
string

◆ addUsages()

Wikibase\Client\Usage\PageEntityUsages::addUsages ( array  $usages)
Parameters
array$usages
Exceptions
InvalidArgumentException

◆ equals()

Wikibase\Client\Usage\PageEntityUsages::equals ( self  $other)
Parameters
self$other
Returns
bool

◆ getAspectKeys()

Wikibase\Client\Usage\PageEntityUsages::getAspectKeys ( )

Collects all usage aspects present on the page.

Aspect keys will include modifiers, use getAspects() if modifiers are not desired.

See also
getAspects()
Returns
string[] Sorted list of full aspect names with modifiers.

◆ getAspects()

Wikibase\Client\Usage\PageEntityUsages::getAspects ( )

Collects all usage aspects present on the page.

Modifiers are not considered, use getAspects() if modifiers should be included.

See also
getAspectKeys()
Returns
string[] Sorted list of aspect names (without modifiers).

◆ getEntityIds()

Wikibase\Client\Usage\PageEntityUsages::getEntityIds ( )

Returns all entities used on the page represented by this PageEntityUsages object.

Returns
EntityId[] List of EntityIde objects, keyed and sorted by their identity string.

◆ getPageId()

Wikibase\Client\Usage\PageEntityUsages::getPageId ( )

Returns the page this PageEntityUsages object applies to.

Returns
int

◆ getUsageAspectKeys()

Wikibase\Client\Usage\PageEntityUsages::getUsageAspectKeys ( EntityId  $id)

Returns the aspects used by the given entity on the page represented by this PageEntityUsages object.

They aspects will include any modifiers.

Parameters
EntityId$id
Returns
string[] List of aspect keys, sorted.

◆ getUsages()

Wikibase\Client\Usage\PageEntityUsages::getUsages ( )
Returns
EntityUsage[] $usages EntityUsage objects keyed and sorted by identity string.

◆ isEmpty()

Wikibase\Client\Usage\PageEntityUsages::isEmpty ( )
Returns
bool

Member Data Documentation

◆ $pageId

Wikibase\Client\Usage\PageEntityUsages::$pageId
private

◆ $usages

Wikibase\Client\Usage\PageEntityUsages::$usages = []
private

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