diff --git a/src/Bundle/ChillMainBundle/Entity/SavedExport.php b/src/Bundle/ChillMainBundle/Entity/SavedExport.php index 3ac361e81..81ca33e72 100644 --- a/src/Bundle/ChillMainBundle/Entity/SavedExport.php +++ b/src/Bundle/ChillMainBundle/Entity/SavedExport.php @@ -18,6 +18,7 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait; use Doctrine\ORM\Mapping as ORM; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity @@ -31,6 +32,7 @@ class SavedExport implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\Column(type="text", nullable=false, options={"default": ""}) + * @Assert\NotBlank */ private string $description = ''; @@ -53,6 +55,7 @@ class SavedExport implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\Column(type="text", nullable=false, options={"default": ""}) + * @Assert\NotBlank */ private string $title = ''; @@ -96,9 +99,9 @@ class SavedExport implements TrackCreationInterface, TrackUpdateInterface return $this->user; } - public function setDescription(string $description): SavedExport + public function setDescription(?string $description): SavedExport { - $this->description = $description; + $this->description = (string) $description; return $this; } @@ -117,9 +120,9 @@ class SavedExport implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setTitle(string $title): SavedExport + public function setTitle(?string $title): SavedExport { - $this->title = $title; + $this->title = (string) $title; return $this; }