protected function validateValueRating()
    {
        $field = 'rating';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Rating');

        if (!isset($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if ($value > 5) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
protected function validateValueRating()
    {
        $field = 'rating';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Rating');

        if (!isset($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if ($value > 5) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
protected function validateValueRating ( ) { $ field = 'rating' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; $ label = $ this -> translation -> text ( 'Rating' ) ; if ( ! isset ( $ value ) ) { $ this -> setErrorRequired ( $ field , $ label ) ; return false ; } if ( ! is_numeric ( $ value ) ) { $ this -> setErrorNumeric ( $ field , $ label ) ; return false ; } if ( $ value > 5 ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } return true ; }
Validates a rating value
@return boolean
Validates a rating value