Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Reference Class Reference

Object that represents a single Wikibase reference. More...

+ Inheritance diagram for Wikibase\DataModel\Reference:
+ Collaboration diagram for Wikibase\DataModel\Reference:

Public Member Functions

 __construct ( $snaks=[])
 An array of Snak objects is only supported since version 1.1.
 
 getSnaks ()
 Returns the property snaks that make up this reference.
 
 count ()
 
 isEmpty ()
 
 getHash ()
 
 equals ( $target)
 The comparison is done purely value based, ignoring the order of the snaks.
 

Private Attributes

 $snaks
 

Detailed Description

Object that represents a single Wikibase reference.

See https://www.mediawiki.org/wiki/Wikibase/DataModel#ReferenceRecords

Since
0.1, instantiable since 0.4
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Reference::__construct ( $snaks = [])

An array of Snak objects is only supported since version 1.1.

Parameters
Snak[] | SnakList$snaks
Exceptions
InvalidArgumentException

Member Function Documentation

◆ count()

Wikibase\DataModel\Reference::count ( )
See also
Countable::count
Since
0.3
Returns
int

◆ equals()

Wikibase\DataModel\Reference::equals ( $target)

The comparison is done purely value based, ignoring the order of the snaks.

Since
0.3
Parameters
mixed$target
Returns
bool

◆ getHash()

Wikibase\DataModel\Reference::getHash ( )
Since
0.1
Returns
string

◆ getSnaks()

Wikibase\DataModel\Reference::getSnaks ( )

Returns the property snaks that make up this reference.

Modification of the snaks should NOT happen through this getter.

Since
0.1
Returns
SnakList

◆ isEmpty()

Wikibase\DataModel\Reference::isEmpty ( )
Since
2.6
Returns
bool

Member Data Documentation

◆ $snaks

Wikibase\DataModel\Reference::$snaks
private

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