Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties Class Reference

A container for a set of property IDs for certain well-known roles. More...

Public Member Functions

 isEmpty ()
 Convenience function to determine whether the properties are completely empty (unconfigured). More...
 

Static Public Member Functions

static newFromArray (array $wellKnownPropertyIds, ?LoggerInterface $logger=null)
 Parse well-known reference properties from an array containing their serializations under the following keys: More...
 

Public Attributes

 $referenceUrlPropertyId
 
 $titlePropertyId
 
 $statedInPropertyId
 
 $authorPropertyId
 
 $publisherPropertyId
 
 $publicationDatePropertyId
 
 $retrievedDatePropertyId
 

Private Member Functions

 __construct (?NumericPropertyId $referenceUrlPropertyId, ?NumericPropertyId $titlePropertyId, ?NumericPropertyId $statedInPropertyId, ?NumericPropertyId $authorPropertyId, ?NumericPropertyId $publisherPropertyId, ?NumericPropertyId $publicationDatePropertyId, ?NumericPropertyId $retrievedDatePropertyId)
 

Static Private Member Functions

static parseWellKnownProperty (array $wellKnownPropertyIds, string $wellKnownName, LoggerInterface $logger)
 

Detailed Description

A container for a set of property IDs for certain well-known roles.

To split a list of reference snaks by these properties, ByWellKnownPropertiesGroupedSnaks can be used.

Instances of this class should be considered immutable; its fields are directly public for convenience, but should not be modified.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::__construct ( ?NumericPropertyId  $referenceUrlPropertyId,
?NumericPropertyId  $titlePropertyId,
?NumericPropertyId  $statedInPropertyId,
?NumericPropertyId  $authorPropertyId,
?NumericPropertyId  $publisherPropertyId,
?NumericPropertyId  $publicationDatePropertyId,
?NumericPropertyId  $retrievedDatePropertyId 
)
private

Member Function Documentation

◆ isEmpty()

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::isEmpty ( )

Convenience function to determine whether the properties are completely empty (unconfigured).

◆ newFromArray()

static Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::newFromArray ( array  $wellKnownPropertyIds,
?LoggerInterface  $logger = null 
)
static

Parse well-known reference properties from an array containing their serializations under the following keys:

  • referenceUrl
  • title
  • statedin
  • author
  • publisher
  • publicationDate
  • retrievedDate
Parameters
string[]$wellKnownPropertyIdsThe property ID serializations.
LoggerInterface | null$loggerUsed to warn on unknown array keys and error on invalid values.
Returns
WellKnownReferenceProperties

◆ parseWellKnownProperty()

static Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::parseWellKnownProperty ( array  $wellKnownPropertyIds,
string  $wellKnownName,
LoggerInterface  $logger 
)
staticprivate

Member Data Documentation

◆ $authorPropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$authorPropertyId

◆ $publicationDatePropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$publicationDatePropertyId

◆ $publisherPropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$publisherPropertyId

◆ $referenceUrlPropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$referenceUrlPropertyId

◆ $retrievedDatePropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$retrievedDatePropertyId

◆ $statedInPropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$statedInPropertyId

◆ $titlePropertyId

Wikibase\Lib\Formatters\Reference\WellKnownReferenceProperties::$titlePropertyId

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