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

@throws ValidationException
321673
public function validate() {

		if ($this->getCurrency() === null) {
			throw new ValidationException("'currency' can't be null", 'currency', $this);
		}
		if ($this->getProduct() === null) {
			throw new ValidationException("'product' can't be null", 'product', $this);
		}
		if ($this->getSubscription() === null) {
			throw new ValidationException("'subscription' can't be null", 'subscription', $this);
		}
	}
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;
			}
		}
	}
1238868
private function validate()
    {
        if (empty($this->modelName) && empty($this->model)) {
            throw new Exception\ModelNotSetException();
        }

        if (empty($this->model)) {
            $this->model = new $this->modelName();
        }

        if (empty($this->modelName)) {
            $this->modelName = get_class($this->model);
        }

        if (empty($this->db)) {
            $this->db = $this->model->getConnection();
        }
    }
935731
protected function validate($obj)
    {
        $errors = $this->container->get('validator')->validate($obj);

        if (count($errors) > 0) {
            throw new ValidationException($errors);
        }
    }
1103335
public function fails()
    {
        if (!($this->validator instanceof \Illuminate\Validation\Validator)) {
            throw new LogicException('No model was set. Nothing to validate.');
        }

        return $this->getValidator()->fails();
    }
785756
public function validate() {

		if ($this->getExternalId() === null) {
			throw new ValidationException("'externalId' can't be null", 'externalId', $this);
		}
		if ($this->getReductions() === null) {
			throw new ValidationException("'reductions' can't be null", 'reductions', $this);
		}
		if ($this->getType() === null) {
			throw new ValidationException("'type' can't be null", 'type', $this);
		}
	}
973831
protected function validateModel()
    {
        if (!$this->model) {
            throw new ApplicationException(Lang::get(
                'backend::lang.form.missing_model',
                ['class'=>get_class($this->controller)]
            ));
        }

        $this->data = isset($this->data)
            ? (object) $this->data
            : $this->model;

        return $this->model;
    }
1121634
private function validate()
    {
        if (!array_key_exists('type', $this->properties)) {
            throw new StatusException(sprintf('Key %s in %s missing', 'type', __CLASS__), 100, null);
        }

        $type = $this->properties['type'];

        // the type specified must be valid
        if (!in_array($this->properties['type'], $this->types)) {
            throw new StatusException('The type specified is invalid', 100, null);
        }

        switch ($type) {
            case StatusInterface::TYPE_INITIAL:
            case StatusInterface::TYPE_EXCEPTION:
                $mandatoryKeys = ['name'];
                break;

            default:
                $mandatoryKeys = ['name', 'transitions_from', 'transitions_to'];
                break;
        }

        foreach ($mandatoryKeys as $key) {
            if (!array_key_exists($key, $this->properties)) {
                throw new StatusException(sprintf('Key %s in %s missing', $key, __CLASS__), 100, null);
            }
        }

        if (StatusInterface::TYPE_INITIAL != $type && StatusInterface::TYPE_EXCEPTION != $type) {
            $keysMustBeArray = ['transitions_from', 'transitions_to'];
            foreach ($keysMustBeArray as $key) {
                if (!is_array($this->properties[$key])) {
                    throw new StatusException(sprintf('Key %s is not an array', $key), 100, null);
                }
            }
        }
    }
1176143
public function validate(array $data)
    {
        try {
            $messages = $this->validateArray($data, $this->nested);

        } catch (\RuntimeException $e) {
            throw (new ValidationException($e->getMessage(), $e->getCode(), $e))->setMessages();
        }

        if (!empty($messages)) {
            throw (new ValidationException())->setMessages($messages);
        }
    }
981304
public function processValidationErrors(array $validationErrors): void
    {
        if (empty($validationErrors)) {
            return;
        }

        $propertyPathGenerator = $this->propertyPathGenerator;
        foreach ($validationErrors as $i => $error) {
            $message = $error->getTranslatableMessage();
            /** @var \Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $violationBuilder */
            $violationBuilder = $this->context->buildViolation($message instanceof Plural ? $message->plural : $message->message);
            $violationBuilder->setParameters($message->values);

            if ($propertyPathGenerator !== null) {
                $propertyPath = $propertyPathGenerator($i, $error->getTarget());
                if ($propertyPath) {
                    $violationBuilder->atPath($propertyPath);
                }
            }

            $violationBuilder->addViolation();
        }
    }
725085
public function validate()
    {
        $attributes = static::getMapper()->getAttributes();
        $keys = $this->isFresh() ? array_keys($attributes) : array_keys($this->dirty);

        foreach ($keys as $key) {
            $attribute = $attributes[$key];

            if ($attribute['auto_generate'] && $this->isFresh()) {
                continue;
            }

            $value = $this->get($key);
            $type = Type::factory($attribute['type']);

            if ($type->isNull($value)) {
                if (!$attribute['allow_null']) {
                    throw new Exception\UnexpectedPropertyValueException(sprintf('%s: Property "%s", not allow null', get_class($this), $key));
                }
            } else {
                if ($attribute['regexp'] && !preg_match($attribute['regexp'], $value)) {
                    throw new Exception\UnexpectedPropertyValueException(sprintf('%s: Property "%s", mismatching pattern %s', get_class($this), $key, $attribute['regexp']));
                }

                if (!$attribute['allow_tags'] && is_string($value) && \Owl\str_has_tags($value)) {
                    throw new Exception\UnexpectedPropertyValueException(sprintf('%s: Property "%s", cannot contain tags', get_class($this), $key));
                }

                try {
                    $type->validateValue($value, $attribute);
                } catch (\Exception $ex) {
                    $message = sprintf('%s: Property "%s", %s', get_class($this), $key, $ex->getMessage());
                    throw new Exception\UnexpectedPropertyValueException($message, 0, $ex);
                }
            }
        }

        return true;
    }
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);
		}
	}
1154051
public function validate() {

		if ($this->getExternalId() === null) {
			throw new ValidationException("'externalId' can't be null", 'externalId', $this);
		}
		if ($this->getLineItems() === null) {
			throw new ValidationException("'lineItems' can't be null", 'lineItems', $this);
		}
	}
1270464
public void validate() {

		ErrorDetails details = null;
		if( this.fileName != null )
			details = ErrorDetails.file( this.fileName );

		if( this.failed ) {
			this.errors.add( new ModelError( ErrorCode.REC_TARGET_INVALID_FILE_OR_CONTENT, this.modelObject, details ));

		} else {
			String id = this.props.getProperty( Constants.TARGET_PROPERTY_ID );
			if( Utils.isEmptyOrWhitespaces( id ))
				this.errors.add( new ModelError( ErrorCode.REC_TARGET_NO_ID, this.modelObject, details ));

			String handler = this.props.getProperty( Constants.TARGET_PROPERTY_HANDLER );
			if( Utils.isEmptyOrWhitespaces( handler ))
				this.errors.add( new ModelError( ErrorCode.REC_TARGET_NO_HANDLER, this.modelObject, details ));

			String name = this.props.getProperty( Constants.TARGET_PROPERTY_NAME );
			if( Utils.isEmptyOrWhitespaces( name ))
				this.errors.add( new ModelError( ErrorCode.REC_TARGET_NO_NAME, this.modelObject, details ));
		}
	}
821994
public function validate() {

		if ($this->getLineItemUniqueId() === null) {
			throw new ValidationException("'lineItemUniqueId' can't be null", 'lineItemUniqueId', $this);
		}
		if ($this->getQuantityReduction() === null) {
			throw new ValidationException("'quantityReduction' can't be null", 'quantityReduction', $this);
		}
		if ($this->getUnitPriceReduction() === null) {
			throw new ValidationException("'unitPriceReduction' can't be null", 'unitPriceReduction', $this);
		}
	}
45171
public function validateUpdateDocument()
    {
        $this->_documentMustHavePrimaryData();
        $this->_primaryDataMustHaveType();
        $this->_primaryDataMustHaveId();
        $this->_primaryDataMayHaveRelationships();

        if ($this->_errorCollection->count() === 0) {
            return;
        }

        throw new ValidationException($this->_getErrorCollectionEntity());
    }
688876
def validate_properties(self, model, context=None):
        
        result = Result()
        for property_name in self.properties:
            prop = self.properties[property_name]
            value = self.get(model, property_name)
            errors = prop.validate(
                value=value,
                model=model,
                context=context
            )

            if errors:
                result.add_errors(
                    errors=errors,
                    property_name=property_name
                )

        return result