Prado\Web\UI\WebControls\TBaseValidator::validate PHP Method

validate() public method

Do not override this method. Override {@link evaluateIsValid} instead.
public validate ( ) : boolean
return boolean whether the validation succeeds
    public function validate()
    {
        $this->onValidate();
        if ($this->getVisible(true) && $this->getEnabled(true)) {
            $target = $this->getValidationTarget();
            // if the target is not a disabled web control
            if ($target === null || $target !== null && !($target instanceof TWebControl && !$target->getEnabled(true))) {
                if ($this->evaluateIsValid()) {
                    $this->setIsValid(true);
                    $this->onValidationSuccess();
                } else {
                    if ($target) {
                        $target->setIsValid(false);
                    }
                    $this->setIsValid(false);
                    $this->onValidationError();
                }
            } else {
                $this->evaluateIsValid();
                $this->setIsValid(true);
                $this->onValidationSuccess();
            }
        } else {
            $this->setIsValid(true);
        }
        return $this->getIsValid();
    }