<?php
namespace App\Entity;
use App\Repository\CompanysRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CompanysRepository::class)]
#[ORM\Index(name: 'companys', columns: ['company_name', 'email', 'tel1'], flags: ['fulltext'])]
class Companys
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 100, nullable: true)]
private $company_name;
#[ORM\Column(type: 'string', length: 100, nullable: true)]
private $adr1;
#[ORM\Column(type: 'string', length: 100, nullable: true)]
private $adr2;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $cp_zip;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $city;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $cedex;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $lat;
#[ORM\Column(type: 'text', nullable: true)]
private $informations;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $lng;
#[ORM\ManyToOne(targetEntity: Carriers::class, inversedBy: 'companys')]
private $carrier;
#[ORM\ManyToOne(targetEntity: RefCountry::class)]
private $ref_country;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $email;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $tel1;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $tel2;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $type;
#[ORM\Column(type: 'string', length: 64, nullable: true)]
private $companys_code_client;
#[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'contractor', orphanRemoval: true, cascade: ['persist'])]
private $tasks_contractor;
#[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'consignee', orphanRemoval: true, cascade: ['persist'])]
private $tasks_consignee;
#[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'sender', orphanRemoval: true, cascade: ['persist'])]
private $tasks_sender;
#[ORM\OneToMany(mappedBy: 'company', targetEntity: EntrepriseAdresseHistory::class)]
private $entrepriseAdresseHistories;
#[ORM\OneToMany(mappedBy: 'sender', targetEntity: Litige::class)]
private Collection $litiges;
public function __construct()
{
$this->entrepriseAdresseHistories = new ArrayCollection();
$this->litiges = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCompanyName(): ?string
{
return $this->company_name;
}
public function setCompanyName(?string $company_name): self
{
$this->company_name = $company_name;
return $this;
}
public function getAdr1(): ?string
{
return $this->adr1;
}
public function setAdr1(?string $adr1): self
{
$this->adr1 = $adr1;
return $this;
}
public function getAdr2(): ?string
{
return $this->adr2;
}
public function setAdr2(?string $adr2): self
{
$this->adr2 = $adr2;
return $this;
}
public function getCpZip(): ?string
{
return $this->cp_zip;
}
public function setCpZip(?string $cp_zip): self
{
$this->cp_zip = $cp_zip;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getCedex(): ?string
{
return $this->cedex;
}
public function setCedex(?string $cedex): self
{
$this->cedex = $cedex;
return $this;
}
public function getLat(): ?string
{
return $this->lat;
}
public function setLat(?string $lat): self
{
$this->lat = $lat;
return $this;
}
public function getInformations(): ?string
{
return $this->informations;
}
public function setInformations(?string $informations): self
{
$this->informations = $informations;
return $this;
}
public function getLng(): ?string
{
return $this->lng;
}
public function setLng(?string $lng): self
{
$this->lng = $lng;
return $this;
}
public function getCarrier(): ?Carriers
{
return $this->carrier;
}
public function setCarrier(?Carriers $carrier): self
{
$this->carrier = $carrier;
return $this;
}
public function getRefCountry(): ?RefCountry
{
return $this->ref_country;
}
public function setRefCountry(?RefCountry $ref_country): self
{
$this->ref_country = $ref_country;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getTel1(): ?string
{
return $this->tel1;
}
public function setTel1(string $tel1): self
{
$this->tel1 = $tel1;
return $this;
}
public function getTel2(): ?string
{
return $this->tel2;
}
public function setTel2(string $tel2): self
{
$this->tel2 = $tel2;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getCompanysCodeClient(): ?string
{
return $this->companys_code_client;
}
public function setCompanysCodeClient(?string $companys_code_client): self
{
$this->companys_code_client = $companys_code_client;
return $this;
}
/**
* @return Collection|Task[]
*/
public function getTasksContractor(): Collection
{
return $this->tasks_contractor;
}
/**
* @return Collection|Task[]
*/
public function getTasksConsignee(): Collection
{
return $this->tasks_consignee;
}
/**
* @return Collection|Task[]
*/
public function getTasksSender(): Collection
{
return $this->tasks_sender;
}
/**
* @return Collection<int, EntrepriseAdresseHistory>
*/
public function getEntrepriseAdresseHistories(): Collection
{
return $this->entrepriseAdresseHistories;
}
public function addEntrepriseAdresseHistory(EntrepriseAdresseHistory $entrepriseAdresseHistory): self
{
if (!$this->entrepriseAdresseHistories->contains($entrepriseAdresseHistory)) {
$this->entrepriseAdresseHistories[] = $entrepriseAdresseHistory;
$entrepriseAdresseHistory->setCompany($this);
}
return $this;
}
public function removeEntrepriseAdresseHistory(EntrepriseAdresseHistory $entrepriseAdresseHistory): self
{
if ($this->entrepriseAdresseHistories->removeElement($entrepriseAdresseHistory)) {
// set the owning side to null (unless already changed)
if ($entrepriseAdresseHistory->getCompany() === $this) {
$entrepriseAdresseHistory->setCompany(null);
}
}
return $this;
}
/**
* @return Collection<int, Litige>
*/
public function getLitiges(): Collection
{
return $this->litiges;
}
public function addLitige(Litige $litige): static
{
if (!$this->litiges->contains($litige)) {
$this->litiges->add($litige);
$litige->setSender($this);
}
return $this;
}
public function removeLitige(Litige $litige): static
{
if ($this->litiges->removeElement($litige)) {
// set the owning side to null (unless already changed)
if ($litige->getSender() === $this) {
$litige->setSender(null);
}
}
return $this;
}
}