mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
Event: move validation to annotation and add UniqueEntity constraint on Participation
This commit is contained in:
@@ -24,6 +24,7 @@ use DateTime;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Event.
|
||||
@@ -40,7 +41,8 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Center")
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Center")A
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private ?Center $center = null;
|
||||
|
||||
@@ -70,6 +72,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=150)
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
private ?string $name = null;
|
||||
|
||||
@@ -84,6 +87,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\EventType")
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private ?EventType $type = null;
|
||||
|
||||
|
Reference in New Issue
Block a user