src/Entity/Task.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TaskRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\Common\Collections\Collection;
  7. use Symfony\Component\Serializer\Annotation\Ignore;
  8. #[ORM\Entity(repositoryClass: TaskRepository::class)]
  9. class Task
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type: 'integer')]
  14.     private $id;
  15.     
  16.     #[ORM\ManyToOne(targetEntity: Companys::class, inversedBy: 'tasks_contractor')]
  17.     private $contractor;
  18.     #[ORM\ManyToOne(targetEntity: Companys::class, inversedBy: 'tasks_consignee')]
  19.     private $consignee;
  20.     #[ORM\ManyToOne(targetEntity: Companys::class, inversedBy: 'tasks_sender')]
  21.     private $sender;
  22.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  23.     private $successive_carriers;
  24.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  25.     private $custom_formalities;
  26.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  27.     private $instructions;
  28.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  29.     private $seal_number;
  30.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  31.     private $cmr;
  32.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  33.     private $mission;
  34.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  35.     private $presta_ann_sender_planned;
  36.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  37.     private $presta_ann_consignee_planned;
  38.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  39.     private $attached_docs;
  40.     #[ORM\ManyToOne(targetEntity: Carriers::class, inversedBy: 'tasks')]
  41.     #[Ignore]
  42.     private $carrier;
  43.     #[ORM\Column(type: 'datetime', nullable: true)]
  44.     private $planned_at;
  45.     #[ORM\Column(type: 'boolean', nullable: true)]
  46.     private $pallet_europe;
  47.     #[ORM\Column(type: 'string', length: 60, nullable: true)]
  48.     private $pallet_other;
  49.     #[ORM\Column(type: 'boolean', nullable: true)]
  50.     private $pallet_80_120;
  51.     #[ORM\Column(type: 'boolean', nullable: true)]
  52.     private $pallet_100_120;
  53.     #[ORM\OneToMany(targetEntity: TaskDriver::class, mappedBy: 'task', orphanRemoval: true, cascade: ['persist'])]
  54.     private $task_drivers;
  55.     #[ORM\OneToMany(targetEntity: TaskVehicule::class, mappedBy: 'task', orphanRemoval: true, cascade: ['persist'])]
  56.     private $task_vehicules;
  57.     #[ORM\ManyToOne(inversedBy: 'tasks')]
  58.     private ?User $createdBy = null;
  59.     #[ORM\Column(type: 'datetime', nullable: true)]
  60.     private $created_at;
  61.     #[ORM\OneToMany(mappedBy: 'task', targetEntity: Upload::class)]
  62.     private Collection $uploads;
  63.     #[ORM\OneToMany(mappedBy: 'task', targetEntity: TaskTracking::class)]
  64.     private Collection $taskTrackings;
  65.     #[ORM\OneToMany(mappedBy: 'task', targetEntity: Litige::class)]
  66.     private Collection $litiges;
  67.     #[ORM\OneToMany(mappedBy: 'task', targetEntity: TourneeTask::class)]
  68.     #[Ignore]
  69.     private Collection $tourneeTasks;
  70.     #[ORM\Column]
  71.     private ?bool $is_tournee_associated = null;
  72.     public function __construct()
  73.     {
  74.         $this->uploads = new ArrayCollection();
  75.         $this->taskTrackings = new ArrayCollection();
  76.         $this->litiges = new ArrayCollection();
  77.         $this->tourneeTasks = new ArrayCollection();
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getContractor(): ?Companys
  84.     {
  85.         return $this->contractor;
  86.     }
  87.     public function setContractor(?Companys $contractor): self
  88.     {
  89.         $this->contractor = $contractor;
  90.         return $this;
  91.     }
  92.     public function getConsignee(): ?Companys
  93.     {
  94.         return $this->consignee;
  95.     }
  96.     public function setConsignee(?Companys $consignee): self
  97.     {
  98.         $this->consignee = $consignee;
  99.         return $this;
  100.     }
  101.     public function getSender(): ?Companys
  102.     {
  103.         return $this->sender;
  104.     }
  105.     public function setSender(?Companys $sender): self
  106.     {
  107.         $this->sender = $sender;
  108.         return $this;
  109.     }
  110.     public function getSuccessiveCarriers(): ?string
  111.     {
  112.         return $this->successive_carriers;
  113.     }
  114.     public function setSuccessiveCarriers(string $successive_carriers): self
  115.     {
  116.         $this->successive_carriers = $successive_carriers;
  117.         return $this;
  118.     }
  119.     public function getCustomFormalities(): ?string
  120.     {
  121.         return $this->custom_formalities;
  122.     }
  123.     public function setCustomFormalities(string $custom_formalities): self
  124.     {
  125.         $this->custom_formalities = $custom_formalities;
  126.         return $this;
  127.     }
  128.     public function getInstructions(): ?string
  129.     {
  130.         return $this->instructions;
  131.     }
  132.     public function setInstructions(string $instructions): self
  133.     {
  134.         $this->instructions = $instructions;
  135.         return $this;
  136.     }
  137.     public function getSealNumber(): ?string
  138.     {
  139.         return $this->seal_number;
  140.     }
  141.     public function setSealNumber(string $seal_number): self
  142.     {
  143.         $this->seal_number = $seal_number;
  144.         return $this;
  145.     }
  146.     
  147.     public function getCmr(): ?string
  148.     {
  149.         return $this->cmr;
  150.     }
  151.     public function setCmr(string $cmr): self
  152.     {
  153.         $this->cmr = $cmr;
  154.         return $this;
  155.     }
  156.     public function getMission(): ?string
  157.     {
  158.         return $this->mission;
  159.     }
  160.     public function setMission(string $mission): self
  161.     {
  162.         $this->mission = $mission;
  163.         return $this;
  164.     }
  165.     public function getPrestaAnnSenderPlanned(): ?string
  166.     {
  167.         return $this->presta_ann_sender_planned;
  168.     }
  169.     public function setPrestaAnnSenderPlanned(string $presta_ann_sender_planned): self
  170.     {
  171.         $this->presta_ann_sender_planned = $presta_ann_sender_planned;
  172.         return $this;
  173.     }
  174.     public function getPrestaAnnConsigneePlanned(): ?string
  175.     {
  176.         return $this->presta_ann_consignee_planned;
  177.     }
  178.     public function setPrestaAnnConsigneePlanned(string $presta_ann_consignee_planned): self
  179.     {
  180.         $this->presta_ann_consignee_planned = $presta_ann_consignee_planned;
  181.         return $this;
  182.     }
  183.     public function getAttachedDocs(): ?string
  184.     {
  185.         return $this->attached_docs;
  186.     }
  187.     public function setAttachedDocs(string $attached_docs): self
  188.     {
  189.         $this->attached_docs = $attached_docs;
  190.         return $this;
  191.     }
  192.     public function getCarrier(): ?Carriers
  193.     {
  194.         return $this->carrier;
  195.     }
  196.     public function setCarrier(?Carriers $carrier): self
  197.     {
  198.         $this->carrier = $carrier;
  199.         return $this;
  200.     }
  201.     public function getPlannedAt(): ?\DateTimeInterface
  202.     {
  203.         return $this->planned_at;
  204.     }
  205.     public function setPlannedAt(?\DateTimeInterface $planned_at): self
  206.     {
  207.         $this->planned_at = $planned_at;
  208.         return $this;
  209.     }
  210.     public function getPalletEurope(): ?bool
  211.     {
  212.         return $this->pallet_europe;
  213.     }
  214.     public function setPalletEurope(?bool $pallet_europe): self
  215.     {
  216.         $this->pallet_europe = $pallet_europe;
  217.         return $this;
  218.     }
  219.     public function getPalletOther(): ?string
  220.     {
  221.         return $this->pallet_other;
  222.     }
  223.     public function setPalletOther(?string $pallet_other): self
  224.     {
  225.         $this->pallet_other = $pallet_other;
  226.         return $this;
  227.     }
  228.     public function getPallet80120(): ?bool
  229.     {
  230.         return $this->pallet_80_120;
  231.     }
  232.     public function setPallet80120(?bool $pallet_80_120): self
  233.     {
  234.         $this->pallet_80_120 = $pallet_80_120;
  235.         return $this;
  236.     }
  237.     public function getPallet100120(): ?bool
  238.     {
  239.         return $this->pallet_100_120;
  240.     }
  241.     public function setPallet100120(?bool $pallet_100_120): self
  242.     {
  243.         $this->pallet_100_120 = $pallet_100_120;
  244.         return $this;
  245.     }
  246.     /**
  247.      * @return Collection|TaskDriver[]
  248.      */
  249.     public function getTaskDrivers(): Collection
  250.     {
  251.         return $this->task_drivers;
  252.     }
  253.     public function addTaskDrivers(TaskDriver $taskDriver): self
  254.     {
  255.         if (!$this->task_drivers->contains($taskDriver)) {
  256.             $this->task_drivers[] = $taskDriver;
  257.             $taskDriver->setTasks($this);
  258.         }
  259.         return $this;
  260.     }
  261.     public function removeTaskDrivers(TaskDriver $taskDriver): self
  262.     {
  263.         if ($this->task_drivers->removeElement($taskDriver)) {
  264.             // set the owning side to null (unless already changed)
  265.             if ($taskDriver->getTasks() === $this) {
  266.                 $taskDriver->setTasks(null);
  267.             }
  268.         }
  269.         return $this;
  270.     }
  271.     /**
  272.      * @return Collection|TaskVehicule[]
  273.      */
  274.     public function getTaskVehicules(): Collection
  275.     {
  276.         return $this->task_vehicules;
  277.     }
  278.     public function addTaskVehciule(TaskVehicule $taskVehicule): self
  279.     {
  280.         if (!$this->task_vehicules->contains($taskVehicule)) {
  281.             $this->task_vehicules[] = $taskVehicule;
  282.             $taskVehicule->setTasks($this);
  283.         }
  284.         return $this;
  285.     }
  286.     public function removeTaskVehicule(TaskVehicule $taskVehicule): self
  287.     {
  288.         if ($this->task_vehicules->removeElement($taskVehicule)) {
  289.             // set the owning side to null (unless already changed)
  290.             if ($taskVehicule->getTasks() === $this) {
  291.                 $taskVehicule->setTasks(null);
  292.             }
  293.         }
  294.         return $this;
  295.     }
  296.     public function getCreatedBy(): ?User
  297.     {
  298.         return $this->createdBy;
  299.     }
  300.     public function setCreatedBy(?User $createdBy): static
  301.     {
  302.         $this->createdBy = $createdBy;
  303.         return $this;
  304.     }
  305.     public function getCreatedAt(): ?\DateTimeInterface
  306.     {
  307.         return $this->created_at;
  308.     }
  309.     public function setCreatedAt(\DateTimeInterface $created_at): self
  310.     {
  311.         $this->created_at = $created_at;
  312.         return $this;
  313.     }
  314.     /**
  315.      * @return Collection<int, Upload>
  316.      */
  317.     public function getUploads(): Collection
  318.     {
  319.         return $this->uploads;
  320.     }
  321.     public function addUpload(Upload $upload): static
  322.     {
  323.         if (!$this->uploads->contains($upload)) {
  324.             $this->uploads->add($upload);
  325.             $upload->setTask($this);
  326.         }
  327.         return $this;
  328.     }
  329.     public function removeUpload(Upload $upload): static
  330.     {
  331.         if ($this->uploads->removeElement($upload)) {
  332.             // set the owning side to null (unless already changed)
  333.             if ($upload->getTask() === $this) {
  334.                 $upload->setTask(null);
  335.             }
  336.         }
  337.         return $this;
  338.     }
  339.     /**
  340.      * @return Collection<int, TaskTracking>
  341.      */
  342.     public function getTaskTrackings(): Collection
  343.     {
  344.         return $this->taskTrackings;
  345.     }
  346.     public function addTaskTracking(TaskTracking $taskTracking): static
  347.     {
  348.         if (!$this->taskTrackings->contains($taskTracking)) {
  349.             $this->taskTrackings->add($taskTracking);
  350.             $taskTracking->setTask($this);
  351.         }
  352.         return $this;
  353.     }
  354.     public function removeTaskTracking(TaskTracking $taskTracking): static
  355.     {
  356.         if ($this->taskTrackings->removeElement($taskTracking)) {
  357.             // set the owning side to null (unless already changed)
  358.             if ($taskTracking->getTask() === $this) {
  359.                 $taskTracking->setTask(null);
  360.             }
  361.         }
  362.         return $this;
  363.     }
  364.     /**
  365.      * @return Collection<int, Litige>
  366.      */
  367.     public function getLitiges(): Collection
  368.     {
  369.         return $this->litiges;
  370.     }
  371.     public function addLitige(Litige $litige): static
  372.     {
  373.         if (!$this->litiges->contains($litige)) {
  374.             $this->litiges->add($litige);
  375.             $litige->setTask($this);
  376.         }
  377.         return $this;
  378.     }
  379.     public function removeLitige(Litige $litige): static
  380.     {
  381.         if ($this->litiges->removeElement($litige)) {
  382.             // set the owning side to null (unless already changed)
  383.             if ($litige->getTask() === $this) {
  384.                 $litige->setTask(null);
  385.             }
  386.         }
  387.         return $this;
  388.     }
  389.     /**
  390.      * @return Collection<int, TourneeTask>
  391.      */
  392.     public function getTourneeTasks(): Collection
  393.     {
  394.         return $this->tourneeTasks;
  395.     }
  396.     public function addTourneeTask(TourneeTask $tourneeTask): static
  397.     {
  398.         if (!$this->tourneeTasks->contains($tourneeTask)) {
  399.             $this->tourneeTasks->add($tourneeTask);
  400.             $tourneeTask->setTask($this);
  401.         }
  402.         return $this;
  403.     }
  404.     public function removeTourneeTask(TourneeTask $tourneeTask): static
  405.     {
  406.         if ($this->tourneeTasks->removeElement($tourneeTask)) {
  407.             // set the owning side to null (unless already changed)
  408.             if ($tourneeTask->getTask() === $this) {
  409.                 $tourneeTask->setTask(null);
  410.             }
  411.         }
  412.         return $this;
  413.     }
  414.     public function isIsTourneeAssociated(): ?bool
  415.     {
  416.         return $this->is_tournee_associated;
  417.     }
  418.     public function setIsTourneeAssociated(bool $is_tournee_associated): static
  419.     {
  420.         $this->is_tournee_associated = $is_tournee_associated;
  421.         return $this;
  422.     }
  423. }