src/Entity/Litige.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LitigeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: LitigeRepository::class)]
  8. #[ORM\Table(name: '`litiges`')]
  9. class Litige
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\ManyToOne(inversedBy: 'litiges')]
  16.     private ?Task $task = null;
  17.     #[ORM\ManyToOne(inversedBy: 'litiges')]
  18.     private ?Companys $sender = null;
  19.     #[ORM\ManyToOne(inversedBy: 'litiges')]
  20.     private ?Companys $consignee = null;
  21.     #[ORM\Column(length: 255, nullable: true)]
  22.     private ?string $possible_reservations = null;
  23.     #[ORM\Column(length: 50, nullable: true)]
  24.     private ?string $type = null;
  25.     #[ORM\ManyToOne(inversedBy: 'litiges')]
  26.     private ?Drivers $driver = null;
  27.     #[ORM\OneToMany(mappedBy: 'litige', targetEntity: LitigeStatusHistory::class)]
  28.     private Collection $litigeStatusHistories;
  29.     #[ORM\ManyToOne(inversedBy: 'litiges')]
  30.     private ?Carriers $carrier = null;
  31.     #[ORM\OneToMany(mappedBy: 'litige', targetEntity: Upload::class)]
  32.     private Collection $uploads;
  33.     public function __construct()
  34.     {
  35.         $this->litigeStatusHistories = new ArrayCollection();
  36.         $this->uploads = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getTask(): ?Task
  43.     {
  44.         return $this->task;
  45.     }
  46.     public function setTask(?Task $task): self
  47.     {
  48.         $this->task = $task;
  49.         return $this;
  50.     }
  51.     public function getSender(): ?Companys
  52.     {
  53.         return $this->sender;
  54.     }
  55.     public function setSender(?Companys $sender): self
  56.     {
  57.         $this->sender = $sender;
  58.         return $this;
  59.     }
  60.     public function getConsignee(): ?Companys
  61.     {
  62.         return $this->consignee;
  63.     }
  64.     public function setConsignee(?Companys $consignee): self
  65.     {
  66.         $this->consignee = $consignee;
  67.         return $this;
  68.     }
  69.     public function getPossibleReservations(): ?string
  70.     {
  71.         return $this->possible_reservations;
  72.     }
  73.     public function setPossibleReservations(?string $possible_reservations): self
  74.     {
  75.         $this->possible_reservations = $possible_reservations;
  76.         return $this;
  77.     }
  78.     public function getType(): ?string
  79.     {
  80.         return $this->type;
  81.     }
  82.     public function setType(?string $type): self
  83.     {
  84.         $this->type = $type;
  85.         return $this;
  86.     }
  87.     public function getDriver(): ?Drivers
  88.     {
  89.         return $this->driver;
  90.     }
  91.     public function setDriver(?Drivers $driver): self
  92.     {
  93.         $this->driver = $driver;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, LitigeStatusHistory>
  98.      */
  99.     public function getLitigeStatusHistories(): Collection
  100.     {
  101.         return $this->litigeStatusHistories;
  102.     }
  103.     public function addLitigeStatusHistory(LitigeStatusHistory $litigeStatusHistory): static
  104.     {
  105.         if (!$this->litigeStatusHistories->contains($litigeStatusHistory)) {
  106.             $this->litigeStatusHistories->add($litigeStatusHistory);
  107.             $litigeStatusHistory->setLitige($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeLitigeStatusHistory(LitigeStatusHistory $litigeStatusHistory): static
  112.     {
  113.         if ($this->litigeStatusHistories->removeElement($litigeStatusHistory)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($litigeStatusHistory->getLitige() === $this) {
  116.                 $litigeStatusHistory->setLitige(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     public function getCarrier(): ?Carriers
  122.     {
  123.         return $this->carrier;
  124.     }
  125.     public function setCarrier(?Carriers $carrier): static
  126.     {
  127.         $this->carrier = $carrier;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, Upload>
  132.      */
  133.     public function getUploads(): Collection
  134.     {
  135.         return $this->uploads;
  136.     }
  137.     public function addUpload(Upload $upload): static
  138.     {
  139.         if (!$this->uploads->contains($upload)) {
  140.             $this->uploads->add($upload);
  141.             $upload->setLitige($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeUpload(Upload $upload): static
  146.     {
  147.         if ($this->uploads->removeElement($upload)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($upload->getLitige() === $this) {
  150.                 $upload->setLitige(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155. }