src/Entity/Carriers.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CarriersRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\Criteria;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Ignore;
  9. #[ORM\Entity(repositoryClass: CarriersRepository::class)]
  10. class Carriers
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type: 'integer')]
  15.     private $id;
  16.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  17.     private $rasion_sociale;
  18.     #[ORM\Column(type: 'string', length: 128, nullable: true)]
  19.     private $adr1;
  20.     #[ORM\Column(type: 'string', length: 128, nullable: true)]
  21.     private $adr2;
  22.     #[ORM\Column(type: 'string', length: 10, nullable: true)]
  23.     private $cp;
  24.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  25.     private $cedex;
  26.     #[ORM\Column(type: 'string', length: 14, nullable: true)]
  27.     private $siret;
  28.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  29.     private $rcs;
  30.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  31.     private $tva;
  32.     #[ORM\Column(type: 'boolean', nullable: true)]
  33.     private $independant;
  34.     #[ORM\Column(type: 'boolean', nullable: true)]
  35.     private $subscription_activated;
  36.     #[ORM\Column(type: 'integer', nullable: true)]
  37.     private $subscription_offer;
  38.     #[ORM\Column(type: 'boolean', nullable: true)]
  39.     private $force_signatures_secur_national;
  40.     #[ORM\Column(type: 'boolean', nullable: true)]
  41.     private $force_signatures_secur_international;
  42.     #[ORM\OneToMany(mappedBy: 'carriers', targetEntity: User::class)]
  43.     private $carriers_id;
  44.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  45.     private $email;
  46.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  47.     private $tel;
  48.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  49.     private $ville;
  50.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Vehicules::class)]
  51.     private $vehicules;
  52.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Drivers::class)]
  53.     private $drivers;
  54.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Companys::class)]
  55.     private $companys;
  56.     #[ORM\ManyToOne(targetEntity: RefCountry::class)]
  57.     private $ref_country;
  58.     #[ORM\OneToMany(mappedBy: 'carriers', targetEntity: CarriersSubscriptions::class)]
  59.     private $carriersSubscriptions;
  60.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Task::class)]
  61.     #[Ignore]
  62.     private $tasks;
  63.     #[ORM\Column(type: 'datetime', nullable: true)]
  64.     private $created_at;
  65.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Litige::class)]
  66.     private Collection $litiges;
  67.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Upload::class)]
  68.     private Collection $uploads;
  69.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Tournee::class)]
  70.     #[Ignore]
  71.     private Collection $tournees;
  72.     #[ORM\OneToMany(mappedBy: 'carrier', targetEntity: MailingAttempsFailed::class)]
  73.     private Collection $mailingAttempsFaileds;
  74.     #[ORM\Column(length: 255, nullable: true)]
  75.     private ?string $site_web = null;
  76.     #[ORM\Column(length: 255, nullable: true)]
  77.     private ?string $code_ape = null;
  78.     #[ORM\Column(length: 255, nullable: true)]
  79.     private ?string $forme = null;
  80.     #[ORM\Column(length: 255, nullable: true)]
  81.     private ?string $capital_social = null;
  82.     #[ORM\Column(nullable: true)]
  83.     private ?int $idOrganization = null;
  84.     public function __construct()
  85.     {
  86.         $this->carriers_id = new ArrayCollection();
  87.         $this->vehicules = new ArrayCollection();
  88.         $this->drivers = new ArrayCollection();
  89.         $this->companys = new ArrayCollection();
  90.         $this->carriersSubscriptions = new ArrayCollection();
  91.         $this->tasks = new ArrayCollection();
  92.         $this->litiges = new ArrayCollection();
  93.         $this->tournees = new ArrayCollection();
  94.         $this->mailingAttempsFaileds = new ArrayCollection();
  95.         $this->uploads = new ArrayCollection();
  96.     }
  97.     public function getId(): ?int
  98.     {
  99.         return $this->id;
  100.     }
  101.     public function getRasionSociale(): ?string
  102.     {
  103.         return $this->rasion_sociale;
  104.     }
  105.     public function setRasionSociale(?string $rasion_sociale): self
  106.     {
  107.         $this->rasion_sociale = $rasion_sociale;
  108.         return $this;
  109.     }
  110.     public function getAdr1(): ?string
  111.     {
  112.         return $this->adr1;
  113.     }
  114.     public function setAdr1(?string $adr1): self
  115.     {
  116.         $this->adr1 = $adr1;
  117.         return $this;
  118.     }
  119.     public function getAdr2(): ?string
  120.     {
  121.         return $this->adr2;
  122.     }
  123.     public function setAdr2(?string $adr2): self
  124.     {
  125.         $this->adr2 = $adr2;
  126.         return $this;
  127.     }
  128.     public function getCp(): ?string
  129.     {
  130.         return $this->cp;
  131.     }
  132.     public function setCp(?string $cp): self
  133.     {
  134.         $this->cp = $cp;
  135.         return $this;
  136.     }
  137.     public function getCedex(): ?string
  138.     {
  139.         return $this->cedex;
  140.     }
  141.     public function setCedex(?string $cedex): self
  142.     {
  143.         $this->cedex = $cedex;
  144.         return $this;
  145.     }
  146.     public function getSiret(): ?string
  147.     {
  148.         return $this->siret;
  149.     }
  150.     public function setSiret(?string $siret): self
  151.     {
  152.         $this->siret = $siret;
  153.         return $this;
  154.     }
  155.     public function getRcs(): ?string
  156.     {
  157.         return $this->rcs;
  158.     }
  159.     public function setRcs(?string $rcs): self
  160.     {
  161.         $this->rcs = $rcs;
  162.         return $this;
  163.     }
  164.     public function getTva(): ?string
  165.     {
  166.         return $this->tva;
  167.     }
  168.     public function setTva(?string $tva): self
  169.     {
  170.         $this->tva = $tva;
  171.         return $this;
  172.     }
  173.     public function getIndependant(): ?int
  174.     {
  175.         return $this->independant;
  176.     }
  177.     public function setIndependant(?int $independant): self
  178.     {
  179.         $this->independant = $independant;
  180.         return $this;
  181.     }
  182.     public function getSubscriptionActivated(): ?int
  183.     {
  184.         return $this->subscription_activated;
  185.     }
  186.     public function setSubscriptionActivated(?int $subscription_activated): self
  187.     {
  188.         $this->subscription_activated = $subscription_activated;
  189.         return $this;
  190.     }
  191.     public function getSubscriptionOffer(): ?int
  192.     {
  193.         return $this->subscription_offer;
  194.     }
  195.     public function setSubscriptionOffer(?int $subscription_offer): self
  196.     {
  197.         $this->subscription_offer = $subscription_offer;
  198.         return $this;
  199.     }
  200.     public function getForceSignaturesSecurNational(): ?int
  201.     {
  202.         return $this->force_signatures_secur_national;
  203.     }
  204.     public function setForceSignaturesSecurNational(?int $force_signatures_secur_national): self
  205.     {
  206.         $this->force_signatures_secur_national = $force_signatures_secur_national;
  207.         return $this;
  208.     }
  209.     public function getForceSignaturesSecurInternational(): ?int
  210.     {
  211.         return $this->force_signatures_secur_international;
  212.     }
  213.     public function setForceSignaturesSecurInternational(?int $force_signatures_secur_international): self
  214.     {
  215.         $this->force_signatures_secur_international = $force_signatures_secur_international;
  216.         return $this;
  217.     }
  218.     /**
  219.      * @return Collection<int, User>
  220.      */
  221.     public function getCarriersId(): Collection
  222.     {
  223.         return $this->carriers_id;
  224.     }
  225.     public function addCarriersId(User $carriersId): self
  226.     {
  227.         if (!$this->carriers_id->contains($carriersId)) {
  228.             $this->carriers_id[] = $carriersId;
  229.             $carriersId->setCarriers($this);
  230.         }
  231.         return $this;
  232.     }
  233.     public function removeCarriersId(User $carriersId): self
  234.     {
  235.         if ($this->carriers_id->removeElement($carriersId)) {
  236.             // set the owning side to null (unless already changed)
  237.             if ($carriersId->getCarriers() === $this) {
  238.                 $carriersId->setCarriers(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243.     /**
  244.      * @return Collection|Upload[]
  245.      */
  246.     public function getUploads(): Collection
  247.     {
  248.         return $this->uploads;
  249.     }
  250.     public function getUploadsByType(string $type): Collection
  251.     {
  252.         return $this->uploads->matching(
  253.             Criteria::create()
  254.                 ->where(Criteria::expr()->eq('type', $type))
  255.         );
  256.     }
  257.     public function removeUpload(Upload $upload): self
  258.     {
  259.         if ($this->uploads->removeElement($upload)) {
  260.             // set the owning side to null (unless already changed)
  261.             if ($upload->getCarrier() === $this) {
  262.                 $upload->setCarrier(null);
  263.             }
  264.         }
  265.         return $this;
  266.     }
  267.     public function getEmail(): ?string
  268.     {
  269.         return $this->email;
  270.     }
  271.     public function setEmail(?string $email): self
  272.     {
  273.         $this->email = $email;
  274.         return $this;
  275.     }
  276.     public function getTel(): ?string
  277.     {
  278.         return $this->tel;
  279.     }
  280.     public function setTel(?string $tel): self
  281.     {
  282.         $this->tel = $tel;
  283.         return $this;
  284.     }
  285.     public function getVille(): ?string
  286.     {
  287.         return $this->ville;
  288.     }
  289.     public function setVille(?string $ville): self
  290.     {
  291.         $this->ville = $ville;
  292.         return $this;
  293.     }
  294.     /**
  295.      * @return Collection<int, Vehicules>
  296.      */
  297.     public function getVehicules(): Collection
  298.     {
  299.         return $this->vehicules;
  300.     }
  301.     public function addVehicule(Vehicules $vehicule): self
  302.     {
  303.         if (!$this->vehicules->contains($vehicule)) {
  304.             $this->vehicules[] = $vehicule;
  305.             $vehicule->setCarrier($this);
  306.         }
  307.         return $this;
  308.     }
  309.     public function removeVehicule(Vehicules $vehicule): self
  310.     {
  311.         if ($this->vehicules->removeElement($vehicule)) {
  312.             // set the owning side to null (unless already changed)
  313.             if ($vehicule->getCarrier() === $this) {
  314.                 $vehicule->setCarrier(null);
  315.             }
  316.         }
  317.         return $this;
  318.     }
  319.     /**
  320.      * @return Collection<int, Drivers>
  321.      */
  322.     public function getDrivers(): Collection
  323.     {
  324.         return $this->drivers;
  325.     }
  326.     public function addDriver(Drivers $driver): self
  327.     {
  328.         if (!$this->drivers->contains($driver)) {
  329.             $this->drivers[] = $driver;
  330.             $driver->setCarrier($this);
  331.         }
  332.         return $this;
  333.     }
  334.     public function removeDriver(Drivers $driver): self
  335.     {
  336.         if ($this->drivers->removeElement($driver)) {
  337.             // set the owning side to null (unless already changed)
  338.             if ($driver->getCarrier() === $this) {
  339.                 $driver->setCarrier(null);
  340.             }
  341.         }
  342.         return $this;
  343.     }
  344.     /**
  345.      * @return Collection<int, Companys>
  346.      */
  347.     public function getCompanys(): Collection
  348.     {
  349.         return $this->companys;
  350.     }
  351.     public function addCompany(Companys $company): self
  352.     {
  353.         if (!$this->companys->contains($company)) {
  354.             $this->companys[] = $company;
  355.             $company->setCarrier($this);
  356.         }
  357.         return $this;
  358.     }
  359.     public function removeCompany(Companys $company): self
  360.     {
  361.         if ($this->companys->removeElement($company)) {
  362.             // set the owning side to null (unless already changed)
  363.             if ($company->getCarrier() === $this) {
  364.                 $company->setCarrier(null);
  365.             }
  366.         }
  367.         return $this;
  368.     }
  369.     public function getRefCountry(): ?RefCountry
  370.     {
  371.         return $this->ref_country;
  372.     }
  373.     public function setRefCountry(?RefCountry $ref_country): self
  374.     {
  375.         $this->ref_country = $ref_country;
  376.         return $this;
  377.     }
  378.     /**
  379.      * @return Collection<int, CarriersSubscriptions>
  380.      */
  381.     public function getCarriersSubscriptions(): Collection
  382.     {
  383.         return $this->carriersSubscriptions;
  384.     }
  385.     public function addCarriersSubscription(CarriersSubscriptions $carriersSubscription): self
  386.     {
  387.         if (!$this->carriersSubscriptions->contains($carriersSubscription)) {
  388.             $this->carriersSubscriptions[] = $carriersSubscription;
  389.             $carriersSubscription->setCarrier($this);
  390.         }
  391.         return $this;
  392.     }
  393.     public function removeCarriersSubscription(CarriersSubscriptions $carriersSubscription): self
  394.     {
  395.         if ($this->carriersSubscriptions->removeElement($carriersSubscription)) {
  396.             // set the owning side to null (unless already changed)
  397.             if ($carriersSubscription->getCarrier() === $this) {
  398.                 $carriersSubscription->setCarrier(null);
  399.             }
  400.         }
  401.         return $this;
  402.     }
  403.     /**
  404.      * @return Collection<int, Task>
  405.      */
  406.     public function getTasks(): Collection
  407.     {
  408.         return $this->tasks;
  409.     }
  410.     public function addTask(Task $task): self
  411.     {
  412.         if (!$this->tasks->contains($task)) {
  413.             $this->tasks[] = $task;
  414.             $task->setCarrier($this);
  415.         }
  416.         return $this;
  417.     }
  418.     public function removeTask(Task $task): self
  419.     {
  420.         if ($this->tasks->removeElement($task)) {
  421.             // set the owning side to null (unless already changed)
  422.             if ($task->getCarrier() === $this) {
  423.                 $task->setCarrier(null);
  424.             }
  425.         }
  426.         return $this;
  427.     }
  428.     public function getCreatedAt(): ?\DateTimeInterface
  429.     {
  430.         return $this->created_at;
  431.     }
  432.     public function setCreatedAt(?\DateTimeInterface $created_at): self
  433.     {
  434.         $this->created_at = $created_at;
  435.         return $this;
  436.     }
  437.     /**
  438.      * @return Collection<int, Litige>
  439.      */
  440.     public function getLitiges(): Collection
  441.     {
  442.         return $this->litiges;
  443.     }
  444.     public function addLitige(Litige $litige): static
  445.     {
  446.         if (!$this->litiges->contains($litige)) {
  447.             $this->litiges->add($litige);
  448.             $litige->setCarrier($this);
  449.         }
  450.         return $this;
  451.     }
  452.     public function removeLitige(Litige $litige): static
  453.     {
  454.         if ($this->litiges->removeElement($litige)) {
  455.             // set the owning side to null (unless already changed)
  456.             if ($litige->getCarrier() === $this) {
  457.                 $litige->setCarrier(null);
  458.             }
  459.         }
  460.         return $this;
  461.     }
  462.     /**
  463.      * @return Collection<int, Tournee>
  464.      */
  465.     public function getTournees(): Collection
  466.     {
  467.         return $this->tournees;
  468.     }
  469.     public function addTournee(Tournee $tournee): static
  470.     {
  471.         if (!$this->tournees->contains($tournee)) {
  472.             $this->tournees->add($tournee);
  473.             $tournee->setCarrier($this);
  474.         }
  475.         return $this;
  476.     }
  477.     public function removeTournee(Tournee $tournee): static
  478.     {
  479.         if ($this->tournees->removeElement($tournee)) {
  480.             // set the owning side to null (unless already changed)
  481.             if ($tournee->getCarrier() === $this) {
  482.                 $tournee->setCarrier(null);
  483.             }
  484.         }
  485.         return $this;
  486.     }
  487.     /**
  488.      * @return Collection<int, MailingAttempsFailed>
  489.      */
  490.     public function getMailingAttempsFaileds(): Collection
  491.     {
  492.         return $this->mailingAttempsFaileds;
  493.     }
  494.     public function addMailingAttempsFailed(MailingAttempsFailed $mailingAttempsFailed): static
  495.     {
  496.         if (!$this->mailingAttempsFaileds->contains($mailingAttempsFailed)) {
  497.             $this->mailingAttempsFaileds->add($mailingAttempsFailed);
  498.             $mailingAttempsFailed->setCarrier($this);
  499.         }
  500.         return $this;
  501.     }
  502.     public function removeMailingAttempsFailed(MailingAttempsFailed $mailingAttempsFailed): static
  503.     {
  504.         if ($this->mailingAttempsFaileds->removeElement($mailingAttempsFailed)) {
  505.             // set the owning side to null (unless already changed)
  506.             if ($mailingAttempsFailed->getCarrier() === $this) {
  507.                 $mailingAttempsFailed->setCarrier(null);
  508.             }
  509.         }
  510.         return $this;
  511.     }
  512.     public function getSiteWeb(): ?string
  513.     {
  514.         return $this->site_web;
  515.     }
  516.     public function setSiteWeb(?string $site_web): static
  517.     {
  518.         $this->site_web = $site_web;
  519.         return $this;
  520.     }
  521.     public function getCodeApe(): ?string
  522.     {
  523.         return $this->code_ape;
  524.     }
  525.     public function setCodeApe(?string $code_ape): static
  526.     {
  527.         $this->code_ape = $code_ape;
  528.         return $this;
  529.     }
  530.     public function getForme(): ?string
  531.     {
  532.         return $this->forme;
  533.     }
  534.     public function setForme(?string $forme): static
  535.     {
  536.         $this->forme = $forme;
  537.         return $this;
  538.     }
  539.     public function getCapitalSocial(): ?string
  540.     {
  541.         return $this->capital_social;
  542.     }
  543.     public function setCapitalSocial(?string $capital_social): static
  544.     {
  545.         $this->capital_social = $capital_social;
  546.         return $this;
  547.     }
  548.     public function getIdOrganization(): ?int
  549.     {
  550.         return $this->idOrganization;
  551.     }
  552.     public function setIdOrganization(?int $idOrganization): static
  553.     {
  554.         $this->idOrganization = $idOrganization;
  555.         return $this;
  556.     }
  557. }