diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 766c74a39..fff378cdb 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -198,13 +198,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface private ?string $email = null; /** - * @ORM\Column(name="firstname", type="string", length=255) - * @Assert\Length(min="2") - * @Assert\NotNull - * @Assert\NotBlank + * @ORM\Column(name="firstname", type="string", length=255, nullable=true) * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) */ - private ?string $firstname = ''; + private ?string $firstname = null; /** * @var int @@ -463,7 +460,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this->email; } - public function getFirstname(): string + public function getFirstname(): ?string { return $this->firstname; } diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 28e87c584..a15bdd634 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -104,7 +104,7 @@ class ThirdPartyType extends AbstractType $builder ->add('firstname', TextType::class, [ 'label' => 'firstname', - 'required' => true, + 'required' => false, ]) ->add('civility', PickCivilityType::class, [ 'label' => 'thirdparty.Civility',