mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: [saved exports] Transform null strings into blank strings, and add validation
This commit is contained in:
parent
00bf7bf299
commit
15871db7fd
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user