Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Entity\Property Class Reference

Represents a single Wikibase property. More...

+ Inheritance diagram for Wikibase\DataModel\Entity\Property:
+ Collaboration diagram for Wikibase\DataModel\Entity\Property:

Public Member Functions

 __construct (?PropertyId $id, ?Fingerprint $fingerprint, $dataTypeId, StatementList $statements=null)
 
 getId ()
 Returns the id of the entity or null if it does not have one. More...
 
 setId ( $id)
 
 getFingerprint ()
 
 setFingerprint (Fingerprint $fingerprint)
 
 getLabels ()
 
 getDescriptions ()
 
 getAliasGroups ()
 
 setLabel ( $languageCode, $value)
 
 setDescription ( $languageCode, $value)
 
 setAliases ( $languageCode, array $aliases)
 
 setDataTypeId ( $dataTypeId)
 
 getDataTypeId ()
 
 getType ()
 
 equals ( $target)
 
 isEmpty ()
 Returns if the Property has no content. More...
 
 getStatements ()
 
 setStatements (StatementList $statements)
 
 copy ()
 
 __clone ()
 
 clear ()
 

Static Public Member Functions

static newFromType ( $dataTypeId)
 

Public Attributes

const ENTITY_TYPE = 'property'
 

Private Attributes

 $id
 
 $fingerprint
 
 $dataTypeId
 
 $statements
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Entity\Property::__construct ( ?PropertyId  $id,
?Fingerprint  $fingerprint,
  $dataTypeId,
StatementList  $statements = null 
)
Since
1.0
Parameters
PropertyId | null$id
Fingerprint | null$fingerprint
string$dataTypeIdThe data type of the property. Not to be confused with the data value type.
StatementList | null$statementsSince 1.1

Member Function Documentation

◆ __clone()

Wikibase\DataModel\Entity\Property::__clone ( )

◆ clear()

Wikibase\DataModel\Entity\Property::clear ( )

◆ copy()

Wikibase\DataModel\Entity\Property::copy ( )
See also
EntityDocument::copy
Since
0.1
Returns
self

Implements Wikibase\DataModel\Entity\EntityDocument.

◆ equals()

Wikibase\DataModel\Entity\Property::equals (   $target)
See also
EntityDocument::equals
Since
0.1
Parameters
mixed$target
Returns
bool

Implements Wikibase\DataModel\Entity\EntityDocument.

◆ getAliasGroups()

Wikibase\DataModel\Entity\Property::getAliasGroups ( )
See also
AliasesProvider::getAliasGroups
Since
6.0
Returns
AliasGroupList

Implements Wikibase\DataModel\Term\AliasesProvider.

◆ getDataTypeId()

Wikibase\DataModel\Entity\Property::getDataTypeId ( )
Since
0.4
Returns
string Returns the data type of the property (property type). Not to be confused with the data value type.

◆ getDescriptions()

Wikibase\DataModel\Entity\Property::getDescriptions ( )

◆ getFingerprint()

Wikibase\DataModel\Entity\Property::getFingerprint ( )
Since
0.7.3
Returns
Fingerprint

Implements Wikibase\DataModel\Term\FingerprintProvider.

◆ getId()

Wikibase\DataModel\Entity\Property::getId ( )

Returns the id of the entity or null if it does not have one.

Since
0.1 return type changed in 0.3
Returns
PropertyId|null

Implements Wikibase\DataModel\Entity\EntityDocument.

◆ getLabels()

Wikibase\DataModel\Entity\Property::getLabels ( )
See also
LabelsProvider::getLabels
Since
6.0
Returns
TermList

Implements Wikibase\DataModel\Term\LabelsProvider.

◆ getStatements()

Wikibase\DataModel\Entity\Property::getStatements ( )
Since
1.1
Returns
StatementList

Implements Wikibase\DataModel\Statement\StatementListProvider.

◆ getType()

Wikibase\DataModel\Entity\Property::getType ( )
See also
Entity::getType
Since
0.1
Returns
string Returns the entity type "property".

Implements Wikibase\DataModel\Entity\EntityDocument.

◆ isEmpty()

Wikibase\DataModel\Entity\Property::isEmpty ( )

Returns if the Property has no content.

Having an id and type set does not count as having content.

Since
0.1
Returns
bool

Implements Wikibase\DataModel\Entity\EntityDocument.

◆ newFromType()

static Wikibase\DataModel\Entity\Property::newFromType (   $dataTypeId)
static
Since
0.3
Parameters
string$dataTypeIdThe data type of the property. Not to be confused with the data value type.
Returns
self

◆ setAliases()

Wikibase\DataModel\Entity\Property::setAliases (   $languageCode,
array  $aliases 
)
Parameters
string$languageCode
string[]$aliases
Exceptions
InvalidArgumentException

◆ setDataTypeId()

Wikibase\DataModel\Entity\Property::setDataTypeId (   $dataTypeId)
Since
0.4
Parameters
string$dataTypeIdThe data type of the property. Not to be confused with the data value type.
Exceptions
InvalidArgumentException

◆ setDescription()

Wikibase\DataModel\Entity\Property::setDescription (   $languageCode,
  $value 
)
Parameters
string$languageCode
string$value
Exceptions
InvalidArgumentException

◆ setFingerprint()

Wikibase\DataModel\Entity\Property::setFingerprint ( Fingerprint  $fingerprint)
Since
0.7.3
Parameters
Fingerprint$fingerprint

◆ setId()

Wikibase\DataModel\Entity\Property::setId (   $id)
Since
0.5, can be null since 1.0
Parameters
PropertyId | null$id
Exceptions
InvalidArgumentException

Implements Wikibase\DataModel\Entity\EntityDocument.

◆ setLabel()

Wikibase\DataModel\Entity\Property::setLabel (   $languageCode,
  $value 
)
Parameters
string$languageCode
string$value
Exceptions
InvalidArgumentException

◆ setStatements()

Wikibase\DataModel\Entity\Property::setStatements ( StatementList  $statements)
Since
1.1
Parameters
StatementList$statements

Implements Wikibase\DataModel\Statement\StatementListHolder.

Member Data Documentation

◆ $dataTypeId

Wikibase\DataModel\Entity\Property::$dataTypeId
private

◆ $fingerprint

Wikibase\DataModel\Entity\Property::$fingerprint
private

◆ $id

Wikibase\DataModel\Entity\Property::$id
private

◆ $statements

Wikibase\DataModel\Entity\Property::$statements
private

◆ ENTITY_TYPE

const Wikibase\DataModel\Entity\Property::ENTITY_TYPE = 'property'

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