protected function validateTextReview()
    {
        $field = 'text';

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

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Text');

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

        $length = mb_strlen($value);
        list($min, $max) = $this->review->getLimits();

        if ($length < $min || $length > $max) {
            $this->setErrorLengthRange($field, $label, $min, $max);
            return false;
        }

        return true;
    }
protected function validateTextReview()
    {
        $field = 'text';

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

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Text');

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

        $length = mb_strlen($value);
        list($min, $max) = $this->review->getLimits();

        if ($length < $min || $length > $max) {
            $this->setErrorLengthRange($field, $label, $min, $max);
            return false;
        }

        return true;
    }
protected function validateTextReview ( ) { $ field = 'text' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; if ( $ this -> isUpdating ( ) && ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } $ label = $ this -> translation -> text ( 'Text' ) ; if ( empty ( $ value ) ) { $ this -> setErrorRequired ( $ field , $ label ) ; return false ; } $ length = mb_strlen ( $ value ) ; list ( $ min , $ max ) = $ this -> review -> getLimits ( ) ; if ( $ length < $ min || $ length > $ max ) { $ this -> setErrorLengthRange ( $ field , $ label , $ min , $ max ) ; return false ; } return true ; }
Validates a review text
@return boolean|null
Validates a review text