mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Fix validation constraints
This commit is contained in:
parent
2552933b05
commit
4f725a3884
3 changed files with 24 additions and 3 deletions
|
|
@ -62,12 +62,11 @@ final class ChannelCodeCollection extends Constraint
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, mixed>|null $options
|
|
||||||
* @param array<Constraint>|null $constraints
|
* @param array<Constraint>|null $constraints
|
||||||
* @param array<string>|null $groups
|
* @param array<string>|null $groups
|
||||||
*/
|
*/
|
||||||
|
#[HasNamedArguments]
|
||||||
public function __construct(
|
public function __construct(
|
||||||
?array $options = null,
|
|
||||||
?array $constraints = null,
|
?array $constraints = null,
|
||||||
?bool $allowExtraFields = null,
|
?bool $allowExtraFields = null,
|
||||||
?bool $allowMissingFields = null,
|
?bool $allowMissingFields = null,
|
||||||
|
|
@ -79,7 +78,7 @@ final class ChannelCodeCollection extends Constraint
|
||||||
?array $groups = null,
|
?array $groups = null,
|
||||||
mixed $payload = null,
|
mixed $payload = null,
|
||||||
) {
|
) {
|
||||||
parent::__construct($options, $groups, $payload);
|
parent::__construct(groups: $groups, payload: $payload);
|
||||||
|
|
||||||
$this->constraints = $constraints ?? $this->constraints;
|
$this->constraints = $constraints ?? $this->constraints;
|
||||||
$this->allowExtraFields = $allowExtraFields ?? $this->allowExtraFields;
|
$this->allowExtraFields = $allowExtraFields ?? $this->allowExtraFields;
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,17 @@ final class ProductVariantOptionValuesConfiguration extends Constraint
|
||||||
parent::__construct(groups: $groups, payload: $payload);
|
parent::__construct(groups: $groups, payload: $payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[HasNamedArguments]
|
||||||
|
public function __construct(
|
||||||
|
string $message = 'sylius.product_variant.option_values.not_configured',
|
||||||
|
?array $groups = null,
|
||||||
|
mixed $payload = null,
|
||||||
|
) {
|
||||||
|
parent::__construct(groups: $groups, payload: $payload);
|
||||||
|
|
||||||
|
$this->message = $message;
|
||||||
|
}
|
||||||
|
|
||||||
public function validatedBy(): string
|
public function validatedBy(): string
|
||||||
{
|
{
|
||||||
return 'sylius.validator.product_variant_option_values_configuration';
|
return 'sylius.validator.product_variant_option_values_configuration';
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,17 @@ final class ValidDeliveryTimeRange extends Constraint
|
||||||
parent::__construct(groups: $groups, payload: $payload);
|
parent::__construct(groups: $groups, payload: $payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[HasNamedArguments]
|
||||||
|
public function __construct(
|
||||||
|
string $message = 'sylius.form.shipping_method.max_delivery_time_days.greater_or_equal_min',
|
||||||
|
?array $groups = null,
|
||||||
|
mixed $payload = null,
|
||||||
|
) {
|
||||||
|
parent::__construct(groups: $groups, payload: $payload);
|
||||||
|
|
||||||
|
$this->message = $message;
|
||||||
|
}
|
||||||
|
|
||||||
public function validatedBy(): string
|
public function validatedBy(): string
|
||||||
{
|
{
|
||||||
return 'sylius_shipping_method_valid_delivery_time_range';
|
return 'sylius_shipping_method_valid_delivery_time_range';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue