33 lines
626 B
PHP
33 lines
626 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Model;
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
class NewsletterSubscriptionRequest
|
|
{
|
|
#[Assert\NotBlank]
|
|
#[Assert\Email(mode: 'strict')]
|
|
public ?string $email = null;
|
|
|
|
#[Assert\Length(max: 255)]
|
|
public ?string $firstName = null;
|
|
|
|
#[Assert\Length(max: 255)]
|
|
public ?string $lastName = null;
|
|
|
|
/**
|
|
* @var list<int>
|
|
*/
|
|
#[Assert\NotNull]
|
|
#[Assert\Type('array')]
|
|
#[Assert\Count(min: 1)]
|
|
#[Assert\All([
|
|
new Assert\Type('integer'),
|
|
new Assert\Positive(),
|
|
])]
|
|
public array $listIds = [];
|
|
}
|