'actorId' => '',
'objectType' => '',
'objectId' => '',
+ 'referenceId' => null,
'creationDT' => null,
'latestChildDT' => null,
];
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.
$data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']);
}
$data['children_count'] = (int)$data['children_count'];
+ $data['reference_id'] = $data['reference_id'] ?? null;
return $data;
}
*/
public function setObject($objectType, $objectId);
+ /**
+ * returns the reference id of the comment
+ *
+ * @return string|null
+ * @since 19.0.0
+ */
+ public function getReferenceId(): ?string;
+
+ /**
+ * sets (overwrites) the reference id of the comment
+ *
+ * @param string|null $referenceId e.g. sha256 hash sum
+ * @return IComment
+ * @since 19.0.0
+ */
+ public function setReferenceId(?string $referenceId): IComment;
+
}