Validates the model's properties and throws a ValidationException if the validation fails.

@throws ValidationException
189306
public function validate() {
		parent::validate();

		if ($this->getName() === null) {
			throw new ValidationException("'name' can't be null", 'name', $this);
		}
		if ($this->getType() === null) {
			throw new ValidationException("'type' can't be null", 'type', $this);
		}
	}
47339
public function validate(Model $model, $value)
    {
        if (!empty($this->choices) && !empty($value)) {
            foreach ($this->choices as $key => $choice) {
                if (is_array($choice)) {
                    foreach ($choice as $inkey => $inchoice) {
                        if ($value === $inchoice) {
                            return;
                        }
                    }
                } else {
                    if ($value === $choice) {
                        return;
                    }
                }
            }

            throw new ValidationError(
                sprintf('Value %s is not a valid choice.', $value),
                'invalid_choice'
            );
        }

        if (is_null($value) && !$this->isNull()) {
            throw new ValidationError('This field cannot be null.', 'null');
        }

        if (empty($value) && !$this->formBlank) {
            throw new ValidationError('This field cannot be blank.', 'blank');
        }
    }
935731
protected function validate($obj)
    {
        $errors = $this->container->get('validator')->validate($obj);

        if (count($errors) > 0) {
            throw new ValidationException($errors);
        }
    }
388104
public function validate() {

		if ($this->getRate() === null) {
			throw new ValidationException("'rate' can't be null", 'rate', $this);
		}
		if ($this->getTitle() === null) {
			throw new ValidationException("'title' can't be null", 'title', $this);
		}
	}
617628
protected function validate($value)
    {
        foreach ($this->validators as $validator) {
            if (!$validator->validate($value)) {
                throw new InvalidValueException(
                    "Field {$this->name}, was set with invalid value: " . var_export($value, true)
                );
            }
        }
    }
1259244
public function validate()
	{
		$errors = array();
		foreach ($this->config->getAllTypeMaps() as $typeMap) {
			try {
				$typeMap->validate();
			} catch (\Exception $e) {
				$errors[] = $e->getMessage();
			}
		}

		if (!empty($errors)) {
			throw new ValidationException(implode("\n\n", $errors));
		}
	}
896386
protected function validate(Model $model)
    {
        $attributes = $model->getAttributes();

        $messages = isset($model->validationMessages) ? $model->validationMessages : [];

        $validator = $this->factory->make($attributes, $model->rules, $messages);

        if ($validator->fails()) {
            throw new ValidationException($validator->getMessageBag());
        }

        if (method_exists($model, 'validate')) {
            $model->validate();
        }
    }
1317614
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (null != $this->validator && false != $this->validator) {
                $validator = $this->validator;
                $valids = array();
                $all_valid = true;
                $pieces = explode(',', $this->user_value);
                foreach ($pieces as $piece) {
                    $result = $validator::quickValidate($piece, $this->constraints);
                    if (null !== $result) {
                        $valids[] = $result;
                    } else {
                        $all_valid = false;
                    }
                }
                $this->user_value = implode(',', $valids);
                $this->is_valid = $all_valid;
                if (!$all_valid) {
                    $this->error = 'The provided value is not valid. Please enter a valid value.';
                }
            } else {
                // This field does not get validated
                $this->is_valid = true;
            }
        }

        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
155901
private function validate() {
        $errors = [];

        foreach ($this->eventDetails as $key => $value) {
            if (strpos($key, 'tp_') !== false) {
                $errors[$key] = 'Property names cannot start with the reserved prefix \'tp_\'';
            }
            if (strpos($key, '.') !== false) {
                $errors[$key] = 'Property names cannot contain a period (.)';
            }
            if (strcmp($key, '_id') == 0) {
                $errors[$key] = 'Top level properties cannot be named \'_id\'';
            }
        }

        if (!empty($errors)) {
            throw new InvalidPropertyNameException($errors);
        }
    }
225345
public function validate($value)
    {
        try {
            $this->_validate($value);
        } catch (RootException $e) {
            if ($e instanceof ValidationFailedExceptionInterface) {
                throw $e;
            }

            $this->_throwValidationException($this->__('Problem validating'), null, $e, true);
        }
    }
826867
@Override
	public void validate() throws HostNameException {
		if(parsedHost != null) {
			return;
		}
		if(validationException != null) {
			throw validationException;
		}
		synchronized(this) {
			if(parsedHost != null) {
				return;
			}
			if(validationException != null) {
				throw validationException;
			}
			try {
				parsedHost = getValidator().validateHost(this);
			} catch(HostNameException e) {
				validationException = e;
				throw e;
			}
		}
	}
267402
public function validate() {

		if ($this->getAmountIncludingTax() === null) {
			throw new ValidationException("'amountIncludingTax' can't be null", 'amountIncludingTax', $this);
		}
		if ($this->getExternalId() === null) {
			throw new ValidationException("'externalId' can't be null", 'externalId', $this);
		}
		if ($this->getQuantity() === null) {
			throw new ValidationException("'quantity' can't be null", 'quantity', $this);
		}
		if ($this->getSubscriptionVersion() === null) {
			throw new ValidationException("'subscriptionVersion' can't be null", 'subscriptionVersion', $this);
		}
		if ($this->getTitle() === null) {
			throw new ValidationException("'title' can't be null", 'title', $this);
		}
	}
874250
@SuppressWarnings("unchecked")
    protected void validate() {

        if (m_ou == null) {
            m_name.removeAllValidators();
            m_name.addValidator(new NameValidator());
        }
        m_description.setRequired(true);
        m_description.setRequiredError("Required");

        if (m_ouResources.getRows().isEmpty() & !m_webuser.getValue().booleanValue()) {
            CmsPathSelectField field = new CmsPathSelectField();
            field.setUseRootPaths(true);
            field.setCmsObject(m_cms);
            m_ouResources.addRow(field);
        }
        for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
            ((AbstractField<String>)row.getComponent()).removeAllValidators();
            ((AbstractField<String>)row.getComponent()).addValidator(new ResourceValidator());
        }
    }
216144
public void validate(Object o)
    {
        Matcher m = m_pattern.matcher(String.valueOf(o));
        if (!m.matches())
        {
            String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(), String.valueOf(o) });
            throw new ValidationException(message);
        }
    }
1248515
public function validate() {

		if ($this->getAmountIncludingTax() === null) {
			throw new ValidationException("'amountIncludingTax' can't be null", 'amountIncludingTax', $this);
		}
		if ($this->getName() === null) {
			throw new ValidationException("'name' can't be null", 'name', $this);
		}
		if ($this->getQuantity() === null) {
			throw new ValidationException("'quantity' can't be null", 'quantity', $this);
		}
		if ($this->getType() === null) {
			throw new ValidationException("'type' can't be null", 'type', $this);
		}
		if ($this->getUniqueId() === null) {
			throw new ValidationException("'uniqueId' can't be null", 'uniqueId', $this);
		}
	}
763150
protected function validate(array $data, array $rules = null): void
    {
        $validator = $this->validatorFactory->make($data, $rules ?? $this->getValidationRules());
        if ($validator->fails()) {
            throw new ValidationException($validator);
        }
    }
874676
public function onValidate(ValidationEvent $event)
    {
        try {
            $this->validator->validate(
                $event->getType(),
                $event->getFile(),
                'upload_validators'
            );
        } catch (JbFileUploaderValidationException $e) {
            throw new ValidationException($e->getMessage(), null, $e);
        }
    }