|
|
|
@ -42,6 +42,7 @@ class Comment implements IComment { |
|
|
|
|
'actorId' => '', |
|
|
|
|
'objectType' => '', |
|
|
|
|
'objectId' => '', |
|
|
|
|
'referenceId' => null, |
|
|
|
|
'creationDT' => null, |
|
|
|
|
'latestChildDT' => null, |
|
|
|
|
]; |
|
|
|
@ -395,6 +396,36 @@ class Comment implements IComment { |
|
|
|
|
return $this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* returns the reference id of the comment |
|
|
|
|
* |
|
|
|
|
* @return string|null |
|
|
|
|
* @since 19.0.0 |
|
|
|
|
*/ |
|
|
|
|
public function getReferenceId(): ?string { |
|
|
|
|
return $this->data['referenceId']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* sets (overwrites) the reference id of the comment |
|
|
|
|
* |
|
|
|
|
* @param string $referenceId e.g. sha256 hash sum |
|
|
|
|
* @return IComment |
|
|
|
|
* @since 19.0.0 |
|
|
|
|
*/ |
|
|
|
|
public function setReferenceId(?string $referenceId): IComment { |
|
|
|
|
if ($referenceId === null) { |
|
|
|
|
$this->data['referenceId'] = $referenceId; |
|
|
|
|
} else { |
|
|
|
|
$referenceId = trim($referenceId); |
|
|
|
|
if ($referenceId === '') { |
|
|
|
|
throw new \InvalidArgumentException('Non empty string expected.'); |
|
|
|
|
} |
|
|
|
|
$this->data['referenceId'] = $referenceId; |
|
|
|
|
} |
|
|
|
|
return $this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* sets the comment data based on an array with keys as taken from the |
|
|
|
|
* database. |
|
|
|
|