Skip to content

Commit e1c1d75

Browse files
matthiasmullieaddshore
authored andcommitted
Add getter for statement guid part
1 parent 8f1eea7 commit e1c1d75

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Statement/StatementGuid.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ class StatementGuid implements Comparable {
2828
*/
2929
private $entityId;
3030

31+
/**
32+
* @var string
33+
*/
34+
private $guid;
35+
3136
/**
3237
* @var string
3338
*/
@@ -46,6 +51,7 @@ public function __construct( EntityId $entityId, $guid ) {
4651

4752
$this->serialization = $entityId->getSerialization() . self::SEPARATOR . $guid;
4853
$this->entityId = $entityId;
54+
$this->guid = $guid;
4955
}
5056

5157
/**
@@ -55,6 +61,13 @@ public function getEntityId() {
5561
return $this->entityId;
5662
}
5763

64+
/**
65+
* @return string
66+
*/
67+
public function getGuid() {
68+
return $this->guid;
69+
}
70+
5871
/**
5972
* @return string
6073
* @deprecated The value returned by this method might differ in case from the original, unparsed statement GUID

tests/unit/Statement/StatementGuidTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function testConstructor( EntityId $entityId, $guid, $expected ) {
2626

2727
$this->assertSame( $expected, $statementGuid->getSerialization() );
2828
$this->assertEquals( $entityId, $statementGuid->getEntityId() );
29+
$this->assertEquals( $guid, $statementGuid->getGuid() );
2930
}
3031

3132
public function provideConstructionData() {

0 commit comments

Comments
 (0)