diff --git a/src/JKetelaar/Kiyoh/Factory/ReviewFactory.php b/src/JKetelaar/Kiyoh/Factory/ReviewFactory.php index 44fc2d7..07fc176 100644 --- a/src/JKetelaar/Kiyoh/Factory/ReviewFactory.php +++ b/src/JKetelaar/Kiyoh/Factory/ReviewFactory.php @@ -62,10 +62,11 @@ public static function createReview(SimpleXMLElement $element): Review $comment = (isset($element->reviewComments) ? $element->reviewComments : ''); $dateSince = $element->dateSince; $updatedSince = $element->updatedSince; + $referenceCode = $element->referenceCode; $content = self::createReviewContent($element->reviewContent->reviewContent); - $review = new Review($id, $author, $city, (float) $rating, $comment, $dateSince, $updatedSince); + $review = new Review($id, $author, $city, (float) $rating, $comment, $dateSince, $updatedSince, $referenceCode); $review->setContent($content); return $review; diff --git a/src/JKetelaar/Kiyoh/Model/Review.php b/src/JKetelaar/Kiyoh/Model/Review.php index c40a16a..e3c147f 100644 --- a/src/JKetelaar/Kiyoh/Model/Review.php +++ b/src/JKetelaar/Kiyoh/Model/Review.php @@ -60,6 +60,7 @@ class Review * @param string $comment * @param string $dateSince * @param string $updatedSince + * @param string $referenceCode */ public function __construct( string $id, @@ -68,13 +69,15 @@ public function __construct( float $rating, string $comment, string $dateSince, - string $updatedSince + string $updatedSince, + string $referenceCode ) { $this->id = $id; $this->author = $author; $this->city = $city; $this->rating = $rating; $this->comment = $comment; + $this->referenceCode = $referenceCode; try { $this->dateSince = new DateTime($dateSince); @@ -284,4 +287,24 @@ public function setUpdatedSince(DateTime $updatedSince): self return $this; } + + /** + * Retrieves the referenceCode from the review. + * @return string + */ + public function getReferenceCode(): string { + return $this->referenceCode; + } + + /** + * @param string $referenceCode + * + * @return Review + */ + public function setReferenceCode(string $referenceCode): self + { + $this->referenceCode = $referenceCode; + + return $this; + } }