public function setRating($rating)
{
$rating = strtolower(trim($rating));
if (!isset($this->validRatings[$rating])) {
$allowed = array_keys($this->validRatings);
$last = array_pop($allowed);
$allowed = join(',', $allowed);
throw new InvalidArgumentException(sprintf("Invalid rating '%s' specified. Available for use only: %s or %s", $rating, $allowed, $last));
}
$this->rating = $rating;
return $this;
}