Add docgen:read group on Person + 2 fields in PersonContext admin form

This commit is contained in:
nobohan
2022-02-28 12:33:38 +01:00
parent d163783ed3
commit 7aefa5014c
3 changed files with 36 additions and 17 deletions

View File

@@ -38,6 +38,7 @@ use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
use Exception;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use function count;
@@ -152,6 +153,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\Column(type="date", nullable=true)
* @Birthdate
* @Groups({"docgen:read"})
*/
private $birthdate;
@@ -200,6 +202,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* sf4 check: option inversedBy="birthsIn" return error mapping !!
*
* @ORM\JoinColumn(nullable=true)
* @Groups({"docgen:read"})
*/
private $countryOfBirth;
@@ -237,6 +240,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @Assert\Date
* @Assert\GreaterThanOrEqual(propertyPath="birthdate")
* @Assert\LessThanOrEqual("today")
* @Groups({"docgen:read"})
*/
private ?DateTimeImmutable $deathdate = null;
@@ -249,6 +253,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @Assert\Email(
* checkMX=true
* )
* @Groups({"docgen:read"})
*/
private $email = '';
@@ -262,6 +267,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @Assert\Length(
* max=255,
* )
* @Groups({"docgen:read"})
*/
private $firstName;
@@ -282,6 +288,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\Column(type="string", length=9, nullable=true)
* @Assert\NotNull(message="The gender must be set")
* @Groups({"docgen:read"})
*/
private $gender;
@@ -339,6 +346,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\MaritalStatus")
* @ORM\JoinColumn(nullable=true)
* @Groups({"docgen:read"})
*/
private $maritalStatus;
@@ -346,6 +354,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* Comment on marital status.
*
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="maritalStatusComment_")
* @Groups({"docgen:read"})
*/
private CommentEmbeddable $maritalStatusComment;
@@ -356,6 +365,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @ORM\Column(type="date", nullable=true)
* @Assert\Date
* @Groups({"docgen:read"})
*/
private ?DateTime $maritalStatusDate = null;
@@ -378,6 +388,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @PhonenumberConstraint(
* type="mobile",
* )
* @Groups({"docgen:read"})
*/
private string $mobilenumber = '';
@@ -391,6 +402,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* sf4 check: option inversedBy="nationals" return error mapping !!
*
* @ORM\JoinColumn(nullable=true)
* @Groups({"docgen:read"})
*/
private $nationality;
@@ -400,6 +412,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @var int
*
* @ORM\Column(type="integer", nullable=true)
* @Groups({"docgen:read"})
*/
private ?int $numberOfChildren = null;
@@ -436,6 +449,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @PhonenumberConstraint(
* type="landline",
* )
* @Groups({"docgen:read"})
*/
private string $phonenumber = '';
@@ -445,6 +459,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @var string
*
* @ORM\Column(type="string", length=255, name="place_of_birth")
* @Groups({"docgen:read"})
*/
private $placeOfBirth = '';