mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
[Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error
This commit is contained in:
@@ -19,6 +19,7 @@ use DateTimeInterface;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
@@ -40,6 +41,8 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
* @Groups({"read", "write"})
|
||||
* @Assert\NotBlank()
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $content;
|
||||
|
||||
|
Reference in New Issue
Block a user