Validates a submitted currency data
@return boolean
556877
protected function validateEditCurrency()
    {
        $this->setSubmitted('currency');
        $this->setSubmittedBool('status');
        $this->setSubmittedBool('default');
        $this->setSubmitted('update', $this->data_currency);

        $this->validateComponent('currency');

        return !$this->hasErrors();
    }
139598
private function validateGreaterThan(): bool
    {
        if ($this->options['inclusive'] === true) {
            $isValid = \mb_strlen($this->value, 'UTF-8') >= $this->options['length'] ? true : false;
            if (!$isValid) {
                $this->setError(self::VALIDATOR_ERROR_STRING_LENGTH_MUST_BE_HIGHER_OR_EQUAL_TO_MIN);
            }
            return $isValid;
        }

        $isValid = \mb_strlen($this->value, 'UTF-8') > $this->options['length'] ? true : false;
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_STRING_LENGTH_MUST_BE_HIGHER_THAN_MIN);
        }
        return $isValid;
    }
1051191
public function isValid()
    {
        // get the submitted value
        $value = $this->field->getForm()->getFieldValue($this->field->getName());

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if multiple values are returned and if this is allowed.
        if (is_array($value) && !$this->field->isMultiple()) {
            return false;
        }

        // check if the submitted value(s) are in the options value's
        $options = $this->field->getOptions();

        if (!is_array($value)) {
            $value = (array)$value;
        }

        // check if the selected options exist
        if (!$this->checkIfOptionsExists($value, $options)) {
            return false;
        }

        return true;
    }
1062370
protected function isCurrencyValid($currencyValue)
    {
        $availableCurrencies = $this->facade->getAvailableCurrencies();
        /** @var Currency $currency */
        $currencyFound = false;
        foreach ($availableCurrencies as $currency) {
            if ($currencyValue == $currency->getCode()) {
                $currencyFound = true;
            }
        }
        if (!$currencyFound) {
            throw new InvalidConditionValueException(
                \get_class(),
                'currency'
            );
        }

        return true;
    }
1289099
protected function validateEditCountryState()
    {
        $this->setSubmitted('state');
        $this->setSubmittedBool('status');
        $this->setSubmitted('update', $this->data_state);
        $this->setSubmitted('country', $this->data_country['code']);

        $this->validateComponent('country_state');

        return !$this->hasErrors();
    }
667785
public function validate()
    {
        $steps = [
            'PrivateKey',
            'IdpMetadata',
            'SpMetadata'
        ];

        foreach ($steps as $step) {
            $method = 'validate' . $step;
            if (!$this->$method()) {
                return false;
            }
        }

        return true;
    }
654602
protected function validateCountryAddress()
    {
        $field = 'country';
        $value = $this->getSubmitted($field);

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

        $country = $this->country->get($value);
        $label = $this->translation->text('Country');

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

        return true;
    }
437693
protected function validateCountry()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->country->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Country'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
915406
protected function validateTransactionOrder()
    {
        $field = 'transaction_id';
        $value = $this->getSubmitted($field);

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

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

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

        if (empty($value)) {
            return true;
        }

        $transaction = $this->transaction->get($value);

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

        return true;
    }
347982
public function isValid()
    {
        $now = new \DateTime('now', new \DateTimeZone('UTC'));
        $timestamp = clone $this->timestamp;

        return $timestamp->add(new \DateInterval($this->validFor)) >= $now;
    }
1011073
public function isValid()
    {
        //validate recurringPayment values
        $checkEmpty = array(
            $this->profileStartDate,
            $this->desc,
            $this->billingPeriod,
            $this->billingFrequency,
            $this->amt,
            $this->currencyCode,
            $this->acct,
            $this->email,
        );

        if(!$this->checkEmpty($checkEmpty) || is_null($this->_address)) {
            return false;
        }

        //address fields
        $address = $this->_address;

        $test = array(
            $address->getStreet(),
            $address->getCity(),
            $address->getState(),
            $address->getCountryCode(),
            $address->getZip()
        );

        if(!$this->checkEmpty($test)) {
            return false;
        }

        return true;
    }
588714
protected function canDeleteCurrency()
    {
        return isset($this->data_currency['code'])
            && $this->access('currency_delete')
            && !$this->isPosted() && $this->currency->canDelete($this->data_currency['code']);
    }
101522
public function ValidateUserInput()
    {
        $bValid = parent::ValidateUserInput();

        $bValid = ($bValid && $this->CheckIncomingHash(TGlobal::instance()->GetUserData()));

        return $bValid;
    }
333336
public function validate()
    {
        $isSubmitted = false;
        foreach ($this->datasources as $ds) {
            if ($ds instanceof HTML_QuickForm2_DataSource_Submit) {
                $isSubmitted = true;
                break;
            }
        }
        return $isSubmitted? parent::validate(): false;
    }
33832
private function isFormatValid()
    {
        $countryCode = $this->getCountryCode();
        $accountIdentification = $this->getAccountIdentification();

        return !(preg_match('/' . static::$ibanFormatMap[$countryCode][1] . '/', $accountIdentification) !== 1);
    }
335134
final public function validate(): bool
    {
        // validate csrf token if required
        if ($this->_tokenRequired && !$this->_tokenOk) {
            App::$Session->getFlashBag()->add('warning', __('Hack attention: security token is wrong!'));
            return false;
        }
        // get all rules as array from method rules()
        $rules = $this->rules();
        // get default values of attributes
        $defaultAttr = $this->getAllProperties();

        // start validation: on this step class attribute values will be changed to input data if it valid
        $success = $this->runValidate($rules);

        // get not-passed validation fields as array
        $badAttributes = $this->getBadAttributes();
        // prevent warnings
        if (Any::isArray($badAttributes) && count($badAttributes) > 0) {
            foreach ($badAttributes as $attr) {
                if (Str::contains('.', $attr)) { // sounds like dot-separated array attr
                    $attrName = strstr($attr, '.', true); // get attr name
                    $attrArray = trim(strstr($attr, '.'), '.'); // get dot-based array path

                    $defaultValue = new DotData($defaultAttr); // load default attr

                    $dotData = new DotData($this->{$attrName}); // load local attr variable
                    $dotData->set($attrArray, $defaultValue->get($attr)); // set to local prop. variable default value

                    $this->{$attrName} = $dotData->export(); // export to model
                } else {
                    $this->{$attr} = $defaultAttr[$attr]; // just set ;)
                }
                // add message about wrong attribute to session holder, later display it
                $attrLabel = $attr;
                if ($this->getLabel($attr) !== null) {
                    $attrLabel = $this->getLabel($attr);
                }

                App::$Session->getFlashBag()->add('warning', __('Field "%field%" is incorrect', ['field' => $attrLabel]));
            }
        }

        return $success;
    }
1150706
public function currency(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateCurrency();
        $this->validateBool('default');
        $this->validateBool('status');
        $this->validateCodeCurrency();
        $this->validateName();
        $this->validateNumericCodeCurrency();
        $this->validateSymbolCurrency();
        $this->validateMajorUnitCurrency();
        $this->validateMinorUnitCurrency();
        $this->validateConvertionRateCurrency();
        $this->validateDecimalsCurrency();
        $this->validateRoundingStepCurrency();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }