src/Entity/InstitutionContactPerson.php line 18

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Entity\Mapped\Entity;
  5. use App\Repository\InstitutionContactPersonRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(
  9.     repositoryClassInstitutionContactPersonRepository::class
  10. )]
  11. #[ORM\Table(
  12.     name'institution_contact_person'
  13. )]
  14. class InstitutionContactPerson 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'email',
  38.         type'string',
  39.         length191,
  40.         nullabletrue
  41.     )]
  42.     #[Assert\NotBlank(
  43.         groups: ['action']
  44.     )]
  45.     private ?string $email null;
  46.     #[ORM\Column(
  47.         name'person_function',
  48.         type'string',
  49.         length191,
  50.         nullabletrue
  51.     )]
  52.     #[Assert\NotBlank(
  53.         groups: ['action']
  54.     )]
  55.     private ?string  $personFunction null;
  56.     #[ORM\Column(
  57.         name'contact',
  58.         type'string',
  59.         length191,
  60.         nullabletrue
  61.     )]
  62.     #[Assert\NotBlank(
  63.         groups: ['action']
  64.     )]
  65.     private ?string $contact null;
  66.     #[ORM\ManyToOne(
  67.         targetEntityInstitution::class,
  68.         cascade: ['persist'],
  69.         inversedBy'contactPerson'
  70.     )]
  71.     #[ORM\JoinColumn(
  72.         name'institution'
  73.     )]
  74.     #[Assert\NotBlank(
  75.         groups: ['action']
  76.     )]
  77.     private ?Institution $institution null;
  78.     public function getFirstName(): ?string
  79.     {
  80.         return $this->firstName;
  81.     }
  82.     public function setFirstName(?string $firstName): self
  83.     {
  84.         $this->firstName $firstName;
  85.         return $this;
  86.     }
  87.     public function getLastName(): ?string
  88.     {
  89.         return $this->lastName;
  90.     }
  91.     public function setLastName(?string $lastName): self
  92.     {
  93.         $this->lastName $lastName;
  94.         return $this;
  95.     }
  96.     public function getPersonFunction(): ?string
  97.     {
  98.         return $this->personFunction;
  99.     }
  100.     public function setPersonFunction(?string $personFunction): self
  101.     {
  102.         $this->personFunction $personFunction;
  103.         return  $this;
  104.     }
  105.     public function getEmail(): ?string
  106.     {
  107.         return $this->email;
  108.     }
  109.     public function setEmail(?string $email): self
  110.     {
  111.         $this->email $email;
  112.         return $this;
  113.     }
  114.     public function getContact(): ?string
  115.     {
  116.         return $this->contact;
  117.     }
  118.     public function setContact(?string $contact): self
  119.     {
  120.         $this->contact $contact;
  121.         return $this;
  122.     }
  123.     public function getInstitution(): ?Institution
  124.     {
  125.         return $this->institution;
  126.     }
  127.     public function setInstitution(?Institution $institution): self
  128.     {
  129.         $this->institution $institution;
  130.         return $this;
  131.     }
  132. }