Happpi PHP Library

getReviewsByPart()

Retrieves the reviews for a specific part.

Return Type

Array of type: CurtReview

Required Parameters

    getReviewsByPart(int $page, int $perpage)

Optional Parameters

    None

Dependencies

    $part->setPartID(int $value)

Example:

<!-- getReviewsByPart() -->
<?php
	require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

	// once the library is required, you can now use one of the main "interaction" classes.
	// These interaction classes contain methods that get information from our REST API and
	// converts them to PHP objects for you to use.
	$Part = new CurtPart(); // create new part object to gain access to its functions.

	echo "<h2>Reviews for Part 11000</h2>";
	echo "<hr />";
	$Part->setPartID(11000);
	$page = 1;
	$perpage = 10;
	$reviews = $Part->getReviewsByPart($page, $perpage);
	foreach($reviews as $review){ // step through the list of part objects
		echo "Rating: " . $review->getRating(); // display each part's shortDesc property using the getter.
		echo "<br />";
		echo "Review Text: " . $review->getReview_text();
		echo "<hr />";
	}
?>