<?php
namespace App\Entity;
use App\Repository\CarriersRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Ignore;
#[ORM\Entity(repositoryClass: CarriersRepository::class)]
class Carriers
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $rasion_sociale;
#[ORM\Column(type: 'string', length: 128, nullable: true)]
private $adr1;
#[ORM\Column(type: 'string', length: 128, nullable: true)]
private $adr2;
#[ORM\Column(type: 'string', length: 10, nullable: true)]
private $cp;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $cedex;
#[ORM\Column(type: 'string', length: 14, nullable: true)]
private $siret;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $rcs;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $tva;
#[ORM\Column(type: 'boolean', nullable: true)]
private $independant;
#[ORM\Column(type: 'boolean', nullable: true)]
private $subscription_activated;
#[ORM\Column(type: 'integer', nullable: true)]
private $subscription_offer;
#[ORM\Column(type: 'boolean', nullable: true)]
private $force_signatures_secur_national;
#[ORM\Column(type: 'boolean', nullable: true)]
private $force_signatures_secur_international;
#[ORM\OneToMany(mappedBy: 'carriers', targetEntity: User::class)]
private $carriers_id;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $email;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $tel;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $ville;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Vehicules::class)]
private $vehicules;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Drivers::class)]
private $drivers;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Companys::class)]
private $companys;
#[ORM\ManyToOne(targetEntity: RefCountry::class)]
private $ref_country;
#[ORM\OneToMany(mappedBy: 'carriers', targetEntity: CarriersSubscriptions::class)]
private $carriersSubscriptions;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Task::class)]
#[Ignore]
private $tasks;
#[ORM\Column(type: 'datetime', nullable: true)]
private $created_at;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Litige::class)]
private Collection $litiges;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Upload::class)]
private Collection $uploads;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: Tournee::class)]
#[Ignore]
private Collection $tournees;
#[ORM\OneToMany(mappedBy: 'carrier', targetEntity: MailingAttempsFailed::class)]
private Collection $mailingAttempsFaileds;
#[ORM\Column(length: 255, nullable: true)]
private ?string $site_web = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $code_ape = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $forme = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $capital_social = null;
#[ORM\Column(nullable: true)]
private ?int $idOrganization = null;
public function __construct()
{
$this->carriers_id = new ArrayCollection();
$this->vehicules = new ArrayCollection();
$this->drivers = new ArrayCollection();
$this->companys = new ArrayCollection();
$this->carriersSubscriptions = new ArrayCollection();
$this->tasks = new ArrayCollection();
$this->litiges = new ArrayCollection();
$this->tournees = new ArrayCollection();
$this->mailingAttempsFaileds = new ArrayCollection();
$this->uploads = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getRasionSociale(): ?string
{
return $this->rasion_sociale;
}
public function setRasionSociale(?string $rasion_sociale): self
{
$this->rasion_sociale = $rasion_sociale;
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 getCp(): ?string
{
return $this->cp;
}
public function setCp(?string $cp): self
{
$this->cp = $cp;
return $this;
}
public function getCedex(): ?string
{
return $this->cedex;
}
public function setCedex(?string $cedex): self
{
$this->cedex = $cedex;
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
public function getRcs(): ?string
{
return $this->rcs;
}
public function setRcs(?string $rcs): self
{
$this->rcs = $rcs;
return $this;
}
public function getTva(): ?string
{
return $this->tva;
}
public function setTva(?string $tva): self
{
$this->tva = $tva;
return $this;
}
public function getIndependant(): ?int
{
return $this->independant;
}
public function setIndependant(?int $independant): self
{
$this->independant = $independant;
return $this;
}
public function getSubscriptionActivated(): ?int
{
return $this->subscription_activated;
}
public function setSubscriptionActivated(?int $subscription_activated): self
{
$this->subscription_activated = $subscription_activated;
return $this;
}
public function getSubscriptionOffer(): ?int
{
return $this->subscription_offer;
}
public function setSubscriptionOffer(?int $subscription_offer): self
{
$this->subscription_offer = $subscription_offer;
return $this;
}
public function getForceSignaturesSecurNational(): ?int
{
return $this->force_signatures_secur_national;
}
public function setForceSignaturesSecurNational(?int $force_signatures_secur_national): self
{
$this->force_signatures_secur_national = $force_signatures_secur_national;
return $this;
}
public function getForceSignaturesSecurInternational(): ?int
{
return $this->force_signatures_secur_international;
}
public function setForceSignaturesSecurInternational(?int $force_signatures_secur_international): self
{
$this->force_signatures_secur_international = $force_signatures_secur_international;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getCarriersId(): Collection
{
return $this->carriers_id;
}
public function addCarriersId(User $carriersId): self
{
if (!$this->carriers_id->contains($carriersId)) {
$this->carriers_id[] = $carriersId;
$carriersId->setCarriers($this);
}
return $this;
}
public function removeCarriersId(User $carriersId): self
{
if ($this->carriers_id->removeElement($carriersId)) {
// set the owning side to null (unless already changed)
if ($carriersId->getCarriers() === $this) {
$carriersId->setCarriers(null);
}
}
return $this;
}
/**
* @return Collection|Upload[]
*/
public function getUploads(): Collection
{
return $this->uploads;
}
public function getUploadsByType(string $type): Collection
{
return $this->uploads->matching(
Criteria::create()
->where(Criteria::expr()->eq('type', $type))
);
}
public function removeUpload(Upload $upload): self
{
if ($this->uploads->removeElement($upload)) {
// set the owning side to null (unless already changed)
if ($upload->getCarrier() === $this) {
$upload->setCarrier(null);
}
}
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(?string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(?string $ville): self
{
$this->ville = $ville;
return $this;
}
/**
* @return Collection<int, Vehicules>
*/
public function getVehicules(): Collection
{
return $this->vehicules;
}
public function addVehicule(Vehicules $vehicule): self
{
if (!$this->vehicules->contains($vehicule)) {
$this->vehicules[] = $vehicule;
$vehicule->setCarrier($this);
}
return $this;
}
public function removeVehicule(Vehicules $vehicule): self
{
if ($this->vehicules->removeElement($vehicule)) {
// set the owning side to null (unless already changed)
if ($vehicule->getCarrier() === $this) {
$vehicule->setCarrier(null);
}
}
return $this;
}
/**
* @return Collection<int, Drivers>
*/
public function getDrivers(): Collection
{
return $this->drivers;
}
public function addDriver(Drivers $driver): self
{
if (!$this->drivers->contains($driver)) {
$this->drivers[] = $driver;
$driver->setCarrier($this);
}
return $this;
}
public function removeDriver(Drivers $driver): self
{
if ($this->drivers->removeElement($driver)) {
// set the owning side to null (unless already changed)
if ($driver->getCarrier() === $this) {
$driver->setCarrier(null);
}
}
return $this;
}
/**
* @return Collection<int, Companys>
*/
public function getCompanys(): Collection
{
return $this->companys;
}
public function addCompany(Companys $company): self
{
if (!$this->companys->contains($company)) {
$this->companys[] = $company;
$company->setCarrier($this);
}
return $this;
}
public function removeCompany(Companys $company): self
{
if ($this->companys->removeElement($company)) {
// set the owning side to null (unless already changed)
if ($company->getCarrier() === $this) {
$company->setCarrier(null);
}
}
return $this;
}
public function getRefCountry(): ?RefCountry
{
return $this->ref_country;
}
public function setRefCountry(?RefCountry $ref_country): self
{
$this->ref_country = $ref_country;
return $this;
}
/**
* @return Collection<int, CarriersSubscriptions>
*/
public function getCarriersSubscriptions(): Collection
{
return $this->carriersSubscriptions;
}
public function addCarriersSubscription(CarriersSubscriptions $carriersSubscription): self
{
if (!$this->carriersSubscriptions->contains($carriersSubscription)) {
$this->carriersSubscriptions[] = $carriersSubscription;
$carriersSubscription->setCarrier($this);
}
return $this;
}
public function removeCarriersSubscription(CarriersSubscriptions $carriersSubscription): self
{
if ($this->carriersSubscriptions->removeElement($carriersSubscription)) {
// set the owning side to null (unless already changed)
if ($carriersSubscription->getCarrier() === $this) {
$carriersSubscription->setCarrier(null);
}
}
return $this;
}
/**
* @return Collection<int, Task>
*/
public function getTasks(): Collection
{
return $this->tasks;
}
public function addTask(Task $task): self
{
if (!$this->tasks->contains($task)) {
$this->tasks[] = $task;
$task->setCarrier($this);
}
return $this;
}
public function removeTask(Task $task): self
{
if ($this->tasks->removeElement($task)) {
// set the owning side to null (unless already changed)
if ($task->getCarrier() === $this) {
$task->setCarrier(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(?\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
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->setCarrier($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->getCarrier() === $this) {
$litige->setCarrier(null);
}
}
return $this;
}
/**
* @return Collection<int, Tournee>
*/
public function getTournees(): Collection
{
return $this->tournees;
}
public function addTournee(Tournee $tournee): static
{
if (!$this->tournees->contains($tournee)) {
$this->tournees->add($tournee);
$tournee->setCarrier($this);
}
return $this;
}
public function removeTournee(Tournee $tournee): static
{
if ($this->tournees->removeElement($tournee)) {
// set the owning side to null (unless already changed)
if ($tournee->getCarrier() === $this) {
$tournee->setCarrier(null);
}
}
return $this;
}
/**
* @return Collection<int, MailingAttempsFailed>
*/
public function getMailingAttempsFaileds(): Collection
{
return $this->mailingAttempsFaileds;
}
public function addMailingAttempsFailed(MailingAttempsFailed $mailingAttempsFailed): static
{
if (!$this->mailingAttempsFaileds->contains($mailingAttempsFailed)) {
$this->mailingAttempsFaileds->add($mailingAttempsFailed);
$mailingAttempsFailed->setCarrier($this);
}
return $this;
}
public function removeMailingAttempsFailed(MailingAttempsFailed $mailingAttempsFailed): static
{
if ($this->mailingAttempsFaileds->removeElement($mailingAttempsFailed)) {
// set the owning side to null (unless already changed)
if ($mailingAttempsFailed->getCarrier() === $this) {
$mailingAttempsFailed->setCarrier(null);
}
}
return $this;
}
public function getSiteWeb(): ?string
{
return $this->site_web;
}
public function setSiteWeb(?string $site_web): static
{
$this->site_web = $site_web;
return $this;
}
public function getCodeApe(): ?string
{
return $this->code_ape;
}
public function setCodeApe(?string $code_ape): static
{
$this->code_ape = $code_ape;
return $this;
}
public function getForme(): ?string
{
return $this->forme;
}
public function setForme(?string $forme): static
{
$this->forme = $forme;
return $this;
}
public function getCapitalSocial(): ?string
{
return $this->capital_social;
}
public function setCapitalSocial(?string $capital_social): static
{
$this->capital_social = $capital_social;
return $this;
}
public function getIdOrganization(): ?int
{
return $this->idOrganization;
}
public function setIdOrganization(?int $idOrganization): static
{
$this->idOrganization = $idOrganization;
return $this;
}
}