Skip to content

Commit e088104

Browse files
committed
Move implementations from Claim to Statement
1 parent c2522f2 commit e088104

1 file changed

Lines changed: 95 additions & 4 deletions

File tree

src/Statement/Statement.php

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,29 @@ class Statement extends Claim {
3131
const RANK_NORMAL = 1;
3232
const RANK_DEPRECATED = 0;
3333

34+
/**
35+
* @since 0.2
36+
*
37+
* @var string|null
38+
*/
39+
private $guid = null;
40+
41+
/**
42+
* @since 0.1
43+
*
44+
* @var Snak
45+
*/
46+
private $mainSnak;
47+
48+
/**
49+
* The property value snaks making up the qualifiers for this statement.
50+
*
51+
* @since 0.1
52+
*
53+
* @var Snaks
54+
*/
55+
private $qualifiers;
56+
3457
/**
3558
* @var ReferenceList
3659
*/
@@ -58,6 +81,78 @@ public function __construct(
5881
$this->references = $references ?: new ReferenceList();
5982
}
6083

84+
/**
85+
* Returns the GUID of this statement.
86+
*
87+
* @since 0.2
88+
*
89+
* @return string|null
90+
*/
91+
public function getGuid() {
92+
return $this->guid;
93+
}
94+
95+
/**
96+
* Sets the GUID of this statement.
97+
*
98+
* @since 0.2
99+
*
100+
* @param string|null $guid
101+
*
102+
* @throws InvalidArgumentException
103+
*/
104+
public function setGuid( $guid ) {
105+
if ( !is_string( $guid ) && $guid !== null ) {
106+
throw new InvalidArgumentException( '$guid must be a string or null' );
107+
}
108+
109+
$this->guid = $guid;
110+
}
111+
112+
/**
113+
* Returns the main value snak of this statement.
114+
*
115+
* @since 0.1
116+
*
117+
* @return Snak
118+
*/
119+
public function getMainSnak() {
120+
return $this->mainSnak;
121+
}
122+
123+
/**
124+
* Sets the main value snak of this statement.
125+
*
126+
* @since 0.1
127+
*
128+
* @param Snak $mainSnak
129+
*/
130+
public function setMainSnak( Snak $mainSnak ) {
131+
$this->mainSnak = $mainSnak;
132+
}
133+
134+
/**
135+
* Returns the property value snaks making up the qualifiers for this statement.
136+
*
137+
* @since 0.1
138+
*
139+
* @return Snaks
140+
*/
141+
public function getQualifiers() {
142+
return $this->qualifiers;
143+
}
144+
145+
/**
146+
* Sets the property value snaks making up the qualifiers for this statement.
147+
*
148+
* @since 0.1
149+
*
150+
* @param Snaks $propertySnaks
151+
*/
152+
public function setQualifiers( Snaks $propertySnaks ) {
153+
$this->qualifiers = $propertySnaks;
154+
}
155+
61156
/**
62157
* Returns the references attached to this statement.
63158
*
@@ -114,8 +209,6 @@ public function setRank( $rank ) {
114209
}
115210

116211
/**
117-
* @see Claim::getRank
118-
*
119212
* @since 0.1
120213
*
121214
* @return integer
@@ -143,8 +236,6 @@ public function getHash() {
143236
}
144237

145238
/**
146-
* @see Claim::getAllSnaks.
147-
*
148239
* In addition to the Snaks returned by Claim::getAllSnaks(), this also includes all
149240
* snaks from any References in this Statement.
150241
*

0 commit comments

Comments
 (0)