Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 89 additions & 4 deletions src/Statement/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ class Statement extends Claim {
const RANK_NORMAL = 1;
const RANK_DEPRECATED = 0;

/**
* @var string|null
*/
protected $guid = null;

/**
* @var Snak
*/
protected $mainSnak;

/**
* The property value snaks making up the qualifiers for this statement.
*
* @var Snaks
*/
protected $qualifiers;

/**
* @var ReferenceList
*/
Expand Down Expand Up @@ -58,6 +75,78 @@ public function __construct(
$this->references = $references ?: new ReferenceList();
}

/**
* Returns the GUID of this statement.
*
* @since 0.2
*
* @return string|null
*/
public function getGuid() {
return $this->guid;
}

/**
* Sets the GUID of this statement.
*
* @since 0.2
*
* @param string|null $guid
*
* @throws InvalidArgumentException
*/
public function setGuid( $guid ) {
if ( !is_string( $guid ) && $guid !== null ) {
throw new InvalidArgumentException( '$guid must be a string or null' );
}

$this->guid = $guid;
}

/**
* Returns the main value snak of this statement.
*
* @since 0.1
*
* @return Snak
*/
public function getMainSnak() {
return $this->mainSnak;
}

/**
* Sets the main value snak of this statement.
*
* @since 0.1
*
* @param Snak $mainSnak
*/
public function setMainSnak( Snak $mainSnak ) {
$this->mainSnak = $mainSnak;
}

/**
* Returns the property value snaks making up the qualifiers for this statement.
*
* @since 0.1
*
* @return Snaks
*/
public function getQualifiers() {
return $this->qualifiers;
}

/**
* Sets the property value snaks making up the qualifiers for this statement.
*
* @since 0.1
*
* @param Snaks $propertySnaks
*/
public function setQualifiers( Snaks $propertySnaks ) {
$this->qualifiers = $propertySnaks;
}

/**
* Returns the references attached to this statement.
*
Expand Down Expand Up @@ -114,8 +203,6 @@ public function setRank( $rank ) {
}

/**
* @see Claim::getRank
*
* @since 0.1
*
* @return integer
Expand Down Expand Up @@ -143,8 +230,6 @@ public function getHash() {
}

/**
* @see Claim::getAllSnaks.
*
* In addition to the Snaks returned by Claim::getAllSnaks(), this also includes all
* snaks from any References in this Statement.
*
Expand Down