Validates.

@param \OxidEsales\Eshop\Application\Model\CompanyVatIn $vatIn

@return bool
191555
public function validate(\OxidEsales\Eshop\Application\Model\CompanyVatIn $vatIn)
    {
        $result = false;
        $country = $this->getCountry();
        if (!is_null($country)) {
            $result = ($country->getVATIdentificationNumberPrefix() === $vatIn->getCountryCode());
            if (!$result) {
                $this->setError(self::ERROR_ID_NOT_VALID);
            }
        }

        return $result;
    }
567717
public function isValid($value)
    {

        //nieprawidłowy typ danych
        if (!is_string($value) && !is_int($value) && !is_float($value)) {
            return $this->_error(self::INVALID);
        }
        //wartość filtrowana alnumem jest równa zadanej, lub nie
        return (new \Mmi\Filter\Alnum())->filter($value) == $value ? true : $this->_error(self::INVALID);
    }
616398
public function isValid($value)
    {
        $this->_setValue($value);
        if (!in_array($value, $this->_haystack, $this->_strict)) {
            $this->_error();
            return false;
        }
        return true;
    }
408918
public function validate($value = "")
    {
        if (is_null($value) && $this->isEmptyAllowed()) {
            return true;
        }

        if ($this->isNullNotAllowed() && is_null($value)) {
            return false;
        }

        return true;
    }
107090
public function validate($value)
    {
        $messenger = $this->messenger->clear();
        return array_reduce(
            $this->func,
            function (&$result, $func) use ($value, $messenger) {
                return $result && $func($value, $messenger);
            },
            true
        );
    }
1189180
public function isValid($value)
    {
        $valid = true;
        $this->setValue($value);

        $result = $this->query($value);
        if (!$result) {
            if ($result === false) {
                $valid = false;
                $this->error(self::ERROR_NOT_ACTIVE);
            } elseif ($this->getOption('property') !== 'NOT_ACTIVE') {
                $valid = false;
                $this->error(self::ERROR_NO_RECORD_FOUND);
            }
        }

        return $valid;
    }
825091
protected function validateIgnoreDocumentMargin($value) {
    if (!is_bool($value) &&
        !in_array($value, ['none', 'left', 'right', 'both'])
    ) {
      $this->triggerError('ignoreDocumentMargin is not valid');
      return FALSE;
    }
    return TRUE;
  }
482889
public function validate($value)
    {
        if ($this->notBeEmpty($value)) {
            $value = json_decode($value);
            if ($value !== null) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
26487
public function isValid($value)
    {
        $messages = [];
        $valid = true;
        foreach ($this->_validators as $validator) {
            if (!$validator->validates($value)) {
                $valid = false;
                $messages[] = $validator->getMessage();
            }
        }
        $this->_messages = $messages;
        return $valid;
    }
71162
public function isValid($value)
    {
        //niepoprawna quera
        if (!($this->getQuery() instanceof \Mmi\Orm\Query)) {
            throw new ValidatorException('No query class supplied.');
        }
        //brak pola
        if (!$this->getField()) {
            throw new ValidatorException('No field name supplied.');
        }
        $q = $this->getQuery();
        /* @var $q \Mmi\Orm\Query */
        $q->where($this->getField())->equals($value);
        if ($this->getId()) {
            $q->andField('id')->notEquals(intval($this->getId()));
        }
        //rekord istnieje
        if ($q->count() > 0) {
            return $this->_error(self::INVALID);
        }
        return true;
    }
572845
public function isValid($value)
    {
        if (!is_scalar($value) || !is_numeric($value)) {
            $this->error(self::INVALID);

            return false;
        }

        $length = strlen($value);

        if ($length < 9) {
            $this->error(self::TOO_SHORT);

            return false;
        }

        if ($length > 9) {
            $this->error(self::TOO_LONG);

            return false;
        }

        if (!parent::isValid($value)) {
            $this->error(self::NO_MATCH);

            return false;
        }

        preg_match($this->pattern, $value, $matches);

        // check for EIN prefixes
        $intPrefix = (int) $matches[1];

        foreach ($this->prefix as $check) {
            if ($intPrefix >= $check[0] && $intPrefix <= $check[1]) {
                return true;
            }
        }

        $this->error(self::NO_MATCH);

        return false;
    }
920484
public function isValid($value)
    {
        $result = filter_var($value, FILTER_VALIDATE_EMAIL);
        if (!$result) {
            $this->addMessage('email');
        }
        return (boolean) $result;
    }
517333
function validateVersion()
    {
        $versionValidated = false;
        $ezversion = eZPublishSDK::version();
        if ( $this->MinVersion !== false )
        {
            if ( $this->MaxVersion !== false )
            {
                if ( version_compare( $this->MinVersion, $ezversion , 'le' ) &&
                     version_compare( $this->MaxVersion, $ezversion , 'ge' ) )
                {
                    return true;
                }
                return false;
            }
            if ( version_compare( $this->MinVersion, $ezversion , 'le' ) )
            {
                return true;
            }
            return false;
        }
        else
        {
            if ( version_compare( $this->MaxVersion, $ezversion , 'ge' ) )
            {
                return true;
            }
            return false;
        }
    }
757578
private function validateIENew(string $vatNumber): bool
    {
        $checksum = strtoupper(substr($vatNumber, 7, 1));
        $checkNumber = substr($vatNumber, 0, 8);
        $checkval = 0;

        for ($i = 2; $i <= 8; $i++) {
            $checkval += (int)$checkNumber[8 - $i] * $i;
        }

        if (strlen($vatNumber) == 9) {
            $checkval += (9 * strpos($this->alphabet, $vatNumber[8]));
        }

        $checkval = ($checkval % 23);

        if ($checkval == 0) {
            return $checksum == 'W';
        }

        $checkchar = 'A';
        for ($i = $checkval - 1; $i > 0; $i--) {
            $checkchar++;
        }

        return $checkchar == $checksum;
    }
1189702
protected function isValid(): bool {
        $parent = parent::isValid();
        $maxSize = parent::size() < $this->maxSize;
        return $parent && $maxSize;
    }
680750
public function isValid($value)
    {
        if (strlen($value) < 6) {
            $this->error(self::INVALID_TOO_SHORT, "Password too short!");

            return false;
        } elseif (strlen($value) > 20) {
            $this->error(self::INVALID_TOO_LONG, "Password too long!");

            return false;
        } elseif (!preg_match("#[0-9]+#", $value)) {
            $this->error(self::INVALID_ONE_NUMBER, "Password must include at least one number!");

            return false;
        } elseif (!preg_match("#[a-z]+#", $value)) {
            $this->error(self::INVALID_ONE_LETTER, "Password must include at least one letter!");

            return false;
        }

        return true;
    }
982319
public function validate()
    {
        if (is_numeric($this->categoryId) && $this->categoryId >= 1
                && is_numeric($this->forumId) && $this->forumId >= 1
                && is_numeric($this->threadId) && $this->threadId >= 1
                && !empty($this->threadSlug)) {
            return true;
        }
        return false;
    }