src/Entity/InstitutionResponsiblePerson.php line 18

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Entity\Mapped\Entity;
  5. use App\Repository\InstitutionResponsiblePersonRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(
  9.     repositoryClassInstitutionResponsiblePersonRepository::class
  10. )]
  11. #[ORM\Table(
  12.     name'institution_responsible_person'
  13. )]
  14. class InstitutionResponsiblePerson extends Entity
  15. {
  16.     #[ORM\Column(
  17.         name'first_name',
  18.         type'string',
  19.         length191,
  20.         nullabletrue
  21.     )]
  22.     #[Assert\NotBlank(
  23.         groups: ['action']
  24.     )]
  25.     private ?string $firstName null;
  26.     #[ORM\Column(
  27.         name'last_name',
  28.         type'string',
  29.         length191,
  30.         nullabletrue
  31.     )]
  32.     #[Assert\NotBlank(
  33.         groups: ['action']
  34.     )]
  35.     private ?string $lastName null;
  36.     #[ORM\Column(
  37.         name'person_function',
  38.         type'string',
  39.         length191,
  40.         nullabletrue
  41.     )]
  42.     #[Assert\NotBlank(
  43.         groups: ['action']
  44.     )]
  45.     private ?string  $personFunction null;
  46.     #[ORM\Column(
  47.         name'contact',
  48.         type'string',
  49.         length191,
  50.         nullabletrue
  51.     )]
  52.     #[Assert\NotBlank(
  53.         groups: ['action']
  54.     )]
  55.     private ?string $contact null;
  56.     #[ORM\ManyToOne(
  57.         targetEntityInstitution::class,
  58.         cascade: ['persist'],
  59.         inversedBy'responsiblePerson'
  60.     )]
  61.     #[ORM\JoinColumn(
  62.         name'institution'
  63.     )]
  64.     #[Assert\NotBlank(
  65.         groups: ['action']
  66.     )]
  67.     private ?Institution $institution null;
  68.     public function getFirstName(): ?string
  69.     {
  70.         return $this->firstName;
  71.     }
  72.     public function setFirstName(?string $firstName): self
  73.     {
  74.         $this->firstName $firstName;
  75.         return $this;
  76.     }
  77.     public function getLastName(): ?string
  78.     {
  79.         return $this->lastName;
  80.     }
  81.     public function setLastName(?string $lastName): self
  82.     {
  83.         $this->lastName $lastName;
  84.         return $this;
  85.     }
  86.     public function getPersonFunction(): ?string
  87.     {
  88.         return $this->personFunction;
  89.     }
  90.     public function setPersonFunction(?string $personFunction): self
  91.     {
  92.         $this->personFunction $personFunction;
  93.         return  $this;
  94.     }
  95.     public function getContact(): ?string
  96.     {
  97.         return $this->contact;
  98.     }
  99.     public function setContact(?string $contact): self
  100.     {
  101.         $this->contact $contact;
  102.         return $this;
  103.     }
  104.     public function getInstitution(): ?Institution
  105.     {
  106.         return $this->institution;
  107.     }
  108.     public function setInstitution(?Institution $institution): self
  109.     {
  110.         $this->institution $institution;
  111.         return $this;
  112.     }
  113. }