<?php
namespace App\Entity;
use App\Repository\PartenaireRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PartenaireRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Partenaire
{
use \App\Traits\EntityDateTimeAbleTrait;
const TYPES = [
1 => "Campus affilié",
2 => "Double diplôme",
3 => "Global Free Mobility Initiative",
4 => "Programme court",
5 => "Services Baguette Academy"
];
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $institution = null;
#[ORM\ManyToOne(inversedBy: 'partenaires')]
private ?Country $country = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $firstName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lastName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $position = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telephone = null;
#[ORM\ManyToOne(inversedBy: 'partenaires')]
private ?Landingpage $agent = null;
#[ORM\OneToMany(mappedBy: 'partenaire', targetEntity: Billing::class, orphanRemoval: true, cascade: ['persist', 'remove'])]
private Collection $billings;
#[ORM\Column(nullable: true)]
private ?int $gender = null;
#[ORM\OneToMany(mappedBy: 'partenaire', targetEntity: PartenaireContact::class, orphanRemoval: true, cascade: ['persist', 'remove'])]
private Collection $contacts;
#[ORM\Column(nullable: true)]
private ?int $status = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $countryCode = null;
#[ORM\Column(nullable: true)]
private ?int $type = null;
public function __construct()
{
$this->billings = new ArrayCollection();
$this->contacts = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getInstitution(): ?string
{
return $this->institution;
}
public function setInstitution(?string $institution): static
{
$this->institution = $institution;
return $this;
}
public function getCountry(): ?Country
{
return $this->country;
}
public function setCountry(?Country $country): static
{
$this->country = $country;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): static
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): static
{
$this->lastName = $lastName;
return $this;
}
public function getPosition(): ?string
{
return $this->position;
}
public function setPosition(?string $position): static
{
$this->position = $position;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): static
{
$this->telephone = $telephone;
return $this;
}
public function getAgent(): ?Landingpage
{
return $this->agent;
}
public function setAgent(?Landingpage $agent): static
{
$this->agent = $agent;
return $this;
}
/**
* @return Collection<int, Billing>
*/
public function getBillings(): Collection
{
return $this->billings;
}
public function addBilling(Billing $billing): static
{
if (!$this->billings->contains($billing)) {
$this->billings->add($billing);
$billing->setPartenaire($this);
}
return $this;
}
public function removeBilling(Billing $billing): static
{
if ($this->billings->removeElement($billing)) {
// set the owning side to null (unless already changed)
if ($billing->getPartenaire() === $this) {
$billing->setPartenaire(null);
}
}
return $this;
}
public function getGender(): ?int
{
return $this->gender;
}
public function setGender(?int $gender): static
{
$this->gender = $gender;
return $this;
}
/**
* @return Collection<int, PartenaireContact>
*/
public function getContacts(): Collection
{
return $this->contacts;
}
public function addContact(PartenaireContact $contact): static
{
if (!$this->contacts->contains($contact)) {
$this->contacts->add($contact);
$contact->setPartenaire($this);
}
return $this;
}
public function removeContact(PartenaireContact $contact): static
{
if ($this->contacts->removeElement($contact)) {
// set the owning side to null (unless already changed)
if ($contact->getPartenaire() === $this) {
$contact->setPartenaire(null);
}
}
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(?int $status): static
{
$this->status = $status;
return $this;
}
public function getCountryCode(): ?string
{
return $this->countryCode;
}
public function setCountryCode(?string $countryCode): static
{
$this->countryCode = $countryCode;
return $this;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(?int $type): static
{
$this->type = $type;
return $this;
}
}