本文整理汇总了PHP中Review::setRating方法的典型用法代码示例。如果您正苦于以下问题:PHP Review::setRating方法的具体用法?PHP Review::setRating怎么用?PHP Review::setRating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Review
的用法示例。
在下文中一共展示了Review::setRating方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateReviews
public function populateReviews($reviewData)
{
foreach ($reviewData as $reviewItem) {
$review = new Review();
$review->setCustomerFirstName($reviewItem['customer_name']);
$review->setCustomerLastName($reviewItem['customer_last_name']);
$submissionDate = date_create($reviewItem['date_of_submission']);
$review->setSubmissionDate(date_format($submissionDate, "M jS, y"));
$review->setCustomerReview($reviewItem['description']);
$review->setRating($reviewItem['rating']);
$review->setReviewFrom($reviewItem['review_from']);
$review->setCustomerURL($reviewItem['customer_url']);
$review->setReviewSource($reviewItem['review_source']);
$review->setReviewURL($reviewItem['review_url']);
$review->setReviewID($reviewItem['review_id']);
$this->_reviews[] = $review;
}
//echo 'Review<pre>'; print_r($reviewData); echo '</pre>';
}
示例2: castToReview
public function castToReview($obj)
{
$r = new Review();
if (isset($obj->reviewID)) {
$r->setReviewID($obj->reviewID);
}
if (isset($obj->partID)) {
$r->setPartID($obj->partID);
}
if (isset($obj->rating)) {
$r->setRating($obj->rating);
}
if (isset($obj->subject)) {
$r->setSubject($obj->subject);
}
if (isset($obj->review_text)) {
$r->setReview_text($obj->review_text);
}
if (isset($obj->name)) {
$r->setName($obj->name);
}
if (isset($obj->email)) {
$r->setEmail($obj->email);
}
if (isset($obj->createdDate)) {
$r->setCreateDate($obj->createdDate);
}
return $r;
}