public function setRating($rating)
    {
        $rating = strtolower($rating);
        $validRatings = array('g', 'pg', 'r', 'x');
        if (!in_array($rating, $validRatings)) {
            throw new InvalidArgumentException(sprintf('Invalid rating "%s" specified, only "g", "pg", "r", or "x" are allowed to be used.', $rating));
        }
        $this->rating = $rating;
        return $this;
    }
public function setRating($rating)
    {
        $rating = strtolower($rating);
        $validRatings = array('g', 'pg', 'r', 'x');
        if (!in_array($rating, $validRatings)) {
            throw new InvalidArgumentException(sprintf('Invalid rating "%s" specified, only "g", "pg", "r", or "x" are allowed to be used.', $rating));
        }
        $this->rating = $rating;
        return $this;
    }
public function setRating ( $ rating ) { $ rating = strtolower ( $ rating ) ; $ validRatings = array ( 'g' , 'pg' , 'r' , 'x' ) ; if ( ! in_array ( $ rating , $ validRatings ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid rating "%s" specified, only "g", "pg", "r", or "x" are allowed to be used.' , $ rating ) ) ; } $ this -> rating = $ rating ; return $ this ; }
Affecte le rating

@param string $rating
@return Gravatar
Affecte le rating