mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
start to simplify validation groups for person
This commit is contained in:
parent
6296c7a307
commit
14aab637eb
@ -216,13 +216,12 @@ final class PersonController extends AbstractController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = $this->createForm(CreationPersonType::class, $person, [
|
$form = $this->createForm(CreationPersonType::class, $person)
|
||||||
'validation_groups' => ['create'],
|
->add('editPerson', SubmitType::class, [
|
||||||
])->add('editPerson', SubmitType::class, [
|
'label' => 'Add the person',
|
||||||
'label' => 'Add the person',
|
])->add('createPeriod', SubmitType::class, [
|
||||||
])->add('createPeriod', SubmitType::class, [
|
'label' => 'Add the person and create an accompanying period',
|
||||||
'label' => 'Add the person and create an accompanying period',
|
]);
|
||||||
]);
|
|
||||||
|
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
@ -153,12 +153,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
* @var DateTime
|
* @var DateTime
|
||||||
*
|
*
|
||||||
* @ORM\Column(type="date", nullable=true)
|
* @ORM\Column(type="date", nullable=true)
|
||||||
* @Assert\Date(
|
* @Assert\Date
|
||||||
* groups={"general", "creation"}
|
* @Birthdate
|
||||||
* )
|
|
||||||
* @Birthdate(
|
|
||||||
* groups={"general", "creation"}
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
private $birthdate;
|
private $birthdate;
|
||||||
|
|
||||||
@ -241,9 +237,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
* @var DateTimeImmutable
|
* @var DateTimeImmutable
|
||||||
*
|
*
|
||||||
* @ORM\Column(type="date_immutable", nullable=true)
|
* @ORM\Column(type="date_immutable", nullable=true)
|
||||||
* @Assert\Date(
|
* @Assert\Date
|
||||||
* groups={"general", "creation"}
|
|
||||||
* )
|
|
||||||
* @Assert\GreaterThanOrEqual(propertyPath="birthdate")
|
* @Assert\GreaterThanOrEqual(propertyPath="birthdate")
|
||||||
* @Assert\LessThanOrEqual("today")
|
* @Assert\LessThanOrEqual("today")
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user