rating = $rating; $this->votes = $votes; } /** * Get the rating * * @since 0.8 * @return Rating */ public function get_rating() { return $this->rating; } /** * Check if the review has any votes. * * @since 0.8 * @return bool */ public function has_votes() { return $this->votes !== null; } /** * Get the optional number of votes. * * @since 0.8 * @return null|Votes */ public function get_votes() { return $this->votes; } /** * Set the optional number of votes. * * @since 0.8 * @param null|Votes $votes */ public function set_votes(Votes $votes = null) { $this->votes = $votes; } /** * Check if this review is equal to the other one. * * @since 0.8 * @param mixed $other * @return bool */ public function is_equal_to($other) { return $other instanceof self && $this->get_rating()->is_equal_to($other->get_rating()) && ($this->has_votes() && $this->get_votes()->is_equal_to($other->get_votes()) || !$other->has_votes()); } }