src/Entity/Partenaire.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PartenaireRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPartenaireRepository::class)]
  8. #[ORM\HasLifecycleCallbacks]
  9. class Partenaire
  10. {
  11.     use \App\Traits\EntityDateTimeAbleTrait;
  12.     const TYPES = [
  13.         => "Campus affilié",
  14.         => "Double diplôme",
  15.         => "Global Free Mobility Initiative",
  16.         => "Programme court",
  17.         => "Services Baguette Academy"
  18.     ];
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue]
  21.     #[ORM\Column]
  22.     private ?int $id null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $institution null;
  25.     #[ORM\ManyToOne(inversedBy'partenaires')]
  26.     private ?Country $country null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $firstName null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $lastName null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $position null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $email null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $telephone null;
  37.     #[ORM\ManyToOne(inversedBy'partenaires')]
  38.     private ?Landingpage $agent null;
  39.     #[ORM\OneToMany(mappedBy'partenaire'targetEntityBilling::class, orphanRemovaltruecascade: ['persist''remove'])]
  40.     private Collection $billings;
  41.     #[ORM\Column(nullabletrue)]
  42.     private ?int $gender null;
  43.     #[ORM\OneToMany(mappedBy'partenaire'targetEntityPartenaireContact::class, orphanRemovaltruecascade: ['persist''remove'])]
  44.     private Collection $contacts;
  45.     #[ORM\Column(nullabletrue)]
  46.     private ?int $status null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $countryCode null;
  49.     #[ORM\Column(nullabletrue)]
  50.     private ?int $type null;
  51.     public function __construct()
  52.     {
  53.         $this->billings = new ArrayCollection();
  54.         $this->contacts = new ArrayCollection();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getInstitution(): ?string
  61.     {
  62.         return $this->institution;
  63.     }
  64.     public function setInstitution(?string $institution): static
  65.     {
  66.         $this->institution $institution;
  67.         return $this;
  68.     }
  69.     public function getCountry(): ?Country
  70.     {
  71.         return $this->country;
  72.     }
  73.     public function setCountry(?Country $country): static
  74.     {
  75.         $this->country $country;
  76.         return $this;
  77.     }
  78.     public function getFirstName(): ?string
  79.     {
  80.         return $this->firstName;
  81.     }
  82.     public function setFirstName(?string $firstName): static
  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): static
  92.     {
  93.         $this->lastName $lastName;
  94.         return $this;
  95.     }
  96.     public function getPosition(): ?string
  97.     {
  98.         return $this->position;
  99.     }
  100.     public function setPosition(?string $position): static
  101.     {
  102.         $this->position $position;
  103.         return $this;
  104.     }
  105.     public function getEmail(): ?string
  106.     {
  107.         return $this->email;
  108.     }
  109.     public function setEmail(?string $email): static
  110.     {
  111.         $this->email $email;
  112.         return $this;
  113.     }
  114.     public function getTelephone(): ?string
  115.     {
  116.         return $this->telephone;
  117.     }
  118.     public function setTelephone(?string $telephone): static
  119.     {
  120.         $this->telephone $telephone;
  121.         return $this;
  122.     }
  123.     public function getAgent(): ?Landingpage
  124.     {
  125.         return $this->agent;
  126.     }
  127.     public function setAgent(?Landingpage $agent): static
  128.     {
  129.         $this->agent $agent;
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection<int, Billing>
  134.      */
  135.     public function getBillings(): Collection
  136.     {
  137.         return $this->billings;
  138.     }
  139.     public function addBilling(Billing $billing): static
  140.     {
  141.         if (!$this->billings->contains($billing)) {
  142.             $this->billings->add($billing);
  143.             $billing->setPartenaire($this);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeBilling(Billing $billing): static
  148.     {
  149.         if ($this->billings->removeElement($billing)) {
  150.             // set the owning side to null (unless already changed)
  151.             if ($billing->getPartenaire() === $this) {
  152.                 $billing->setPartenaire(null);
  153.             }
  154.         }
  155.         return $this;
  156.     }
  157.     public function getGender(): ?int
  158.     {
  159.         return $this->gender;
  160.     }
  161.     public function setGender(?int $gender): static
  162.     {
  163.         $this->gender $gender;
  164.         return $this;
  165.     }
  166.     /**
  167.      * @return Collection<int, PartenaireContact>
  168.      */
  169.     public function getContacts(): Collection
  170.     {
  171.         return $this->contacts;
  172.     }
  173.     public function addContact(PartenaireContact $contact): static
  174.     {
  175.         if (!$this->contacts->contains($contact)) {
  176.             $this->contacts->add($contact);
  177.             $contact->setPartenaire($this);
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeContact(PartenaireContact $contact): static
  182.     {
  183.         if ($this->contacts->removeElement($contact)) {
  184.             // set the owning side to null (unless already changed)
  185.             if ($contact->getPartenaire() === $this) {
  186.                 $contact->setPartenaire(null);
  187.             }
  188.         }
  189.         return $this;
  190.     }
  191.     public function getStatus(): ?int
  192.     {
  193.         return $this->status;
  194.     }
  195.     public function setStatus(?int $status): static
  196.     {
  197.         $this->status $status;
  198.         return $this;
  199.     }
  200.     public function getCountryCode(): ?string
  201.     {
  202.         return $this->countryCode;
  203.     }
  204.     public function setCountryCode(?string $countryCode): static
  205.     {
  206.         $this->countryCode $countryCode;
  207.         return $this;
  208.     }
  209.     public function getType(): ?int
  210.     {
  211.         return $this->type;
  212.     }
  213.     public function setType(?int $type): static
  214.     {
  215.         $this->type $type;
  216.         return $this;
  217.     }
  218. }