src/Entity/Companys.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CompanysRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: CompanysRepository::class)]
  8. #[ORM\Index(name: 'companys', columns: ['company_name', 'email', 'tel1'], flags: ['fulltext'])]
  9. class Companys
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type: 'integer')]
  14.     private $id;
  15.     #[ORM\Column(type: 'string', length: 100, nullable: true)]
  16.     private $company_name;
  17.     #[ORM\Column(type: 'string', length: 100, nullable: true)]
  18.     private $adr1;
  19.     #[ORM\Column(type: 'string', length: 100, nullable: true)]
  20.     private $adr2;
  21.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  22.     private $cp_zip;
  23.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  24.     private $city;
  25.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  26.     private $cedex;
  27.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  28.     private $lat;
  29.     #[ORM\Column(type: 'text', nullable: true)]
  30.     private $informations;
  31.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  32.     private $lng;
  33.     #[ORM\ManyToOne(targetEntity: Carriers::class, inversedBy: 'companys')]
  34.     private $carrier;
  35.     #[ORM\ManyToOne(targetEntity: RefCountry::class)]
  36.     private $ref_country;
  37.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  38.     private $email;
  39.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  40.     private $tel1;
  41.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  42.     private $tel2;
  43.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  44.     private $type;
  45.     #[ORM\Column(type: 'string', length: 64, nullable: true)]
  46.     private $companys_code_client;
  47.     #[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'contractor', orphanRemoval: true, cascade: ['persist'])]
  48.     private $tasks_contractor;
  49.     #[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'consignee', orphanRemoval: true, cascade: ['persist'])]
  50.     private $tasks_consignee;
  51.     #[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'sender', orphanRemoval: true, cascade: ['persist'])]
  52.     private $tasks_sender;
  53.     #[ORM\OneToMany(mappedBy: 'company', targetEntity: EntrepriseAdresseHistory::class)]
  54.     private $entrepriseAdresseHistories;
  55.     #[ORM\OneToMany(mappedBy: 'sender', targetEntity: Litige::class)]
  56.     private Collection $litiges;
  57.     public function __construct()
  58.     {
  59.         $this->entrepriseAdresseHistories = new ArrayCollection();
  60.         $this->litiges = new ArrayCollection();
  61.     }
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getCompanyName(): ?string
  67.     {
  68.         return $this->company_name;
  69.     }
  70.     public function setCompanyName(?string $company_name): self
  71.     {
  72.         $this->company_name = $company_name;
  73.         return $this;
  74.     }
  75.     public function getAdr1(): ?string
  76.     {
  77.         return $this->adr1;
  78.     }
  79.     public function setAdr1(?string $adr1): self
  80.     {
  81.         $this->adr1 = $adr1;
  82.         return $this;
  83.     }
  84.     public function getAdr2(): ?string
  85.     {
  86.         return $this->adr2;
  87.     }
  88.     public function setAdr2(?string $adr2): self
  89.     {
  90.         $this->adr2 = $adr2;
  91.         return $this;
  92.     }
  93.     public function getCpZip(): ?string
  94.     {
  95.         return $this->cp_zip;
  96.     }
  97.     public function setCpZip(?string $cp_zip): self
  98.     {
  99.         $this->cp_zip = $cp_zip;
  100.         return $this;
  101.     }
  102.     public function getCity(): ?string
  103.     {
  104.         return $this->city;
  105.     }
  106.     public function setCity(?string $city): self
  107.     {
  108.         $this->city = $city;
  109.         return $this;
  110.     }
  111.     public function getCedex(): ?string
  112.     {
  113.         return $this->cedex;
  114.     }
  115.     public function setCedex(?string $cedex): self
  116.     {
  117.         $this->cedex = $cedex;
  118.         return $this;
  119.     }
  120.     public function getLat(): ?string
  121.     {
  122.         return $this->lat;
  123.     }
  124.     public function setLat(?string $lat): self
  125.     {
  126.         $this->lat = $lat;
  127.         return $this;
  128.     }
  129.     public function getInformations(): ?string
  130.     {
  131.         return $this->informations;
  132.     }
  133.     public function setInformations(?string $informations): self
  134.     {
  135.         $this->informations = $informations;
  136.         return $this;
  137.     }
  138.     public function getLng(): ?string
  139.     {
  140.         return $this->lng;
  141.     }
  142.     public function setLng(?string $lng): self
  143.     {
  144.         $this->lng = $lng;
  145.         return $this;
  146.     }
  147.     public function getCarrier(): ?Carriers
  148.     {
  149.         return $this->carrier;
  150.     }
  151.     public function setCarrier(?Carriers $carrier): self
  152.     {
  153.         $this->carrier = $carrier;
  154.         return $this;
  155.     }
  156.     public function getRefCountry(): ?RefCountry
  157.     {
  158.         return $this->ref_country;
  159.     }
  160.     public function setRefCountry(?RefCountry $ref_country): self
  161.     {
  162.         $this->ref_country = $ref_country;
  163.         return $this;
  164.     }
  165.     public function getEmail(): ?string
  166.     {
  167.         return $this->email;
  168.     }
  169.     public function setEmail(string $email): self
  170.     {
  171.         $this->email = $email;
  172.         return $this;
  173.     }
  174.     public function getTel1(): ?string
  175.     {
  176.         return $this->tel1;
  177.     }
  178.     public function setTel1(string $tel1): self
  179.     {
  180.         $this->tel1 = $tel1;
  181.         return $this;
  182.     }
  183.     public function getTel2(): ?string
  184.     {
  185.         return $this->tel2;
  186.     }
  187.     public function setTel2(string $tel2): self
  188.     {
  189.         $this->tel2 = $tel2;
  190.         return $this;
  191.     }
  192.     public function getType(): ?string
  193.     {
  194.         return $this->type;
  195.     }
  196.     public function setType(?string $type): self
  197.     {
  198.         $this->type = $type;
  199.         return $this;
  200.     }
  201.     public function getCompanysCodeClient(): ?string
  202.     {
  203.         return $this->companys_code_client;
  204.     }
  205.     public function setCompanysCodeClient(?string $companys_code_client): self
  206.     {
  207.         $this->companys_code_client = $companys_code_client;
  208.         return $this;
  209.     }
  210.     /**
  211.      * @return Collection|Task[]
  212.      */
  213.     public function getTasksContractor(): Collection
  214.     {
  215.         return $this->tasks_contractor;
  216.     }
  217.     /**
  218.      * @return Collection|Task[]
  219.      */
  220.     public function getTasksConsignee(): Collection
  221.     {
  222.         return $this->tasks_consignee;
  223.     }
  224.     /**
  225.      * @return Collection|Task[]
  226.      */
  227.     public function getTasksSender(): Collection
  228.     {
  229.         return $this->tasks_sender;
  230.     }
  231.     /**
  232.      * @return Collection<int, EntrepriseAdresseHistory>
  233.      */
  234.     public function getEntrepriseAdresseHistories(): Collection
  235.     {
  236.         return $this->entrepriseAdresseHistories;
  237.     }
  238.     public function addEntrepriseAdresseHistory(EntrepriseAdresseHistory $entrepriseAdresseHistory): self
  239.     {
  240.         if (!$this->entrepriseAdresseHistories->contains($entrepriseAdresseHistory)) {
  241.             $this->entrepriseAdresseHistories[] = $entrepriseAdresseHistory;
  242.             $entrepriseAdresseHistory->setCompany($this);
  243.         }
  244.         return $this;
  245.     }
  246.     public function removeEntrepriseAdresseHistory(EntrepriseAdresseHistory $entrepriseAdresseHistory): self
  247.     {
  248.         if ($this->entrepriseAdresseHistories->removeElement($entrepriseAdresseHistory)) {
  249.             // set the owning side to null (unless already changed)
  250.             if ($entrepriseAdresseHistory->getCompany() === $this) {
  251.                 $entrepriseAdresseHistory->setCompany(null);
  252.             }
  253.         }
  254.         return $this;
  255.     }
  256.     /**
  257.      * @return Collection<int, Litige>
  258.      */
  259.     public function getLitiges(): Collection
  260.     {
  261.         return $this->litiges;
  262.     }
  263.     public function addLitige(Litige $litige): static
  264.     {
  265.         if (!$this->litiges->contains($litige)) {
  266.             $this->litiges->add($litige);
  267.             $litige->setSender($this);
  268.         }
  269.         return $this;
  270.     }
  271.     public function removeLitige(Litige $litige): static
  272.     {
  273.         if ($this->litiges->removeElement($litige)) {
  274.             // set the owning side to null (unless already changed)
  275.             if ($litige->getSender() === $this) {
  276.                 $litige->setSender(null);
  277.             }
  278.         }
  279.         return $this;
  280.     }
  281. }