|
|
@@ -10,6 +10,7 @@ use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
use Symfony\Component\Serializer\Annotation\Groups;
|
|
|
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
/**
|
|
|
* Sous-domaine enregistré par une organisation
|
|
|
@@ -44,6 +45,7 @@ class Subdomain
|
|
|
|
|
|
#[ORM\Column(type: 'string', length: 60, unique: true, nullable: false)]
|
|
|
#[Groups("subdomain")]
|
|
|
+ #[Assert\Regex('/^[\w\-]+$/', 'Subdomains can not contains whitespaces or special characters')]
|
|
|
private string $subdomain;
|
|
|
|
|
|
#[ORM\Column(options: ['default' => false])]
|