feat: improved validation of personal data
This commit is contained in:
1 parent
011fe9c5c4
commit
9c1aa60782
5 files changed
+53
-27
No files matched your search
@@ -2,11 +2,19 @@
|
||||
|
||||
namespace App\BusProNet\Model;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class Communication
|
||||
{
|
||||
public ?string $phone = null;
|
||||
public ?string $mobile = null;
|
||||
public ?string $email = null;
|
||||
public ?string $phone = '';
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
|
||||
public ?string $mobile = '';
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
|
||||
#[Assert\Email(message: 'Bitte eine gültige Adresse angeben', mode: 'strict', groups: ['personal_data'])]
|
||||
public ?string $email = '';
|
||||
|
||||
public bool $newsletter = false;
|
||||
|
||||
public function toPayload(): array
|
||||
@@ -18,4 +26,4 @@ class Communication
|
||||
'newsletter' => $this->newsletter ? 'True' : 'False',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user