Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Entity\Int32EntityId Interface Reference

Interface for EntityIds that can be converted to a positive, signed 32 bit integer in the range [1..2147483647], and back from the entity type and the number. More...

+ Inheritance diagram for Wikibase\DataModel\Entity\Int32EntityId:

Public Member Functions

 getNumericId ()
 

Public Attributes

const MAX = 2147483647
 

Detailed Description

Interface for EntityIds that can be converted to a positive, signed 32 bit integer in the range [1..2147483647], and back from the entity type and the number.

The number must be distinct for different IDs. When an ID can not be represented as a distinct integer, an InvalidArgumentException must be thrown on construction time. For example, when "Q1" and "Q01" have the same integer representation, only one should be allowed.

Entity types that do not meet this criteria should not implement this interface.

Entity types are not required and not guaranteed to implement this interface. Use the full string serialization whenever you can and avoid using numeric IDs.

Since
6.1
Author
Thiemo Kreuz

Member Function Documentation

◆ getNumericId()

Wikibase\DataModel\Entity\Int32EntityId::getNumericId ( )
Since
6.1
Returns
int Guaranteed to be a distinct integer in the range [1..2147483647].

Implemented in Wikibase\DataModel\Entity\NumericPropertyId, and Wikibase\DataModel\Entity\ItemId.

Member Data Documentation

◆ MAX

const Wikibase\DataModel\Entity\Int32EntityId::MAX = 2147483647

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