<?php
namespace App\Entity;
use App\Repository\TaskRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Annotation\Ignore;
#[ORM\Entity(repositoryClass: TaskRepository::class)]
class Task
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Companys::class, inversedBy: 'tasks_contractor')]
private $contractor;
#[ORM\ManyToOne(targetEntity: Companys::class, inversedBy: 'tasks_consignee')]
private $consignee;
#[ORM\ManyToOne(targetEntity: Companys::class, inversedBy: 'tasks_sender')]
private $sender;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $successive_carriers;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $custom_formalities;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $instructions;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $seal_number;
#[ORM\Column(type: 'string', length: 45, nullable: true)]
private $cmr;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $mission;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $presta_ann_sender_planned;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $presta_ann_consignee_planned;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $attached_docs;
#[ORM\ManyToOne(targetEntity: Carriers::class, inversedBy: 'tasks')]
#[Ignore]
private $carrier;
#[ORM\Column(type: 'datetime', nullable: true)]
private $planned_at;
#[ORM\Column(type: 'boolean', nullable: true)]
private $pallet_europe;
#[ORM\Column(type: 'string', length: 60, nullable: true)]
private $pallet_other;
#[ORM\Column(type: 'boolean', nullable: true)]
private $pallet_80_120;
#[ORM\Column(type: 'boolean', nullable: true)]
private $pallet_100_120;
#[ORM\OneToMany(targetEntity: TaskDriver::class, mappedBy: 'task', orphanRemoval: true, cascade: ['persist'])]
private $task_drivers;
#[ORM\OneToMany(targetEntity: TaskVehicule::class, mappedBy: 'task', orphanRemoval: true, cascade: ['persist'])]
private $task_vehicules;
#[ORM\ManyToOne(inversedBy: 'tasks')]
private ?User $createdBy = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private $created_at;
#[ORM\OneToMany(mappedBy: 'task', targetEntity: Upload::class)]
private Collection $uploads;
#[ORM\OneToMany(mappedBy: 'task', targetEntity: TaskTracking::class)]
private Collection $taskTrackings;
#[ORM\OneToMany(mappedBy: 'task', targetEntity: Litige::class)]
private Collection $litiges;
#[ORM\OneToMany(mappedBy: 'task', targetEntity: TourneeTask::class)]
#[Ignore]
private Collection $tourneeTasks;
#[ORM\Column]
private ?bool $is_tournee_associated = null;
public function __construct()
{
$this->uploads = new ArrayCollection();
$this->taskTrackings = new ArrayCollection();
$this->litiges = new ArrayCollection();
$this->tourneeTasks = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getContractor(): ?Companys
{
return $this->contractor;
}
public function setContractor(?Companys $contractor): self
{
$this->contractor = $contractor;
return $this;
}
public function getConsignee(): ?Companys
{
return $this->consignee;
}
public function setConsignee(?Companys $consignee): self
{
$this->consignee = $consignee;
return $this;
}
public function getSender(): ?Companys
{
return $this->sender;
}
public function setSender(?Companys $sender): self
{
$this->sender = $sender;
return $this;
}
public function getSuccessiveCarriers(): ?string
{
return $this->successive_carriers;
}
public function setSuccessiveCarriers(string $successive_carriers): self
{
$this->successive_carriers = $successive_carriers;
return $this;
}
public function getCustomFormalities(): ?string
{
return $this->custom_formalities;
}
public function setCustomFormalities(string $custom_formalities): self
{
$this->custom_formalities = $custom_formalities;
return $this;
}
public function getInstructions(): ?string
{
return $this->instructions;
}
public function setInstructions(string $instructions): self
{
$this->instructions = $instructions;
return $this;
}
public function getSealNumber(): ?string
{
return $this->seal_number;
}
public function setSealNumber(string $seal_number): self
{
$this->seal_number = $seal_number;
return $this;
}
public function getCmr(): ?string
{
return $this->cmr;
}
public function setCmr(string $cmr): self
{
$this->cmr = $cmr;
return $this;
}
public function getMission(): ?string
{
return $this->mission;
}
public function setMission(string $mission): self
{
$this->mission = $mission;
return $this;
}
public function getPrestaAnnSenderPlanned(): ?string
{
return $this->presta_ann_sender_planned;
}
public function setPrestaAnnSenderPlanned(string $presta_ann_sender_planned): self
{
$this->presta_ann_sender_planned = $presta_ann_sender_planned;
return $this;
}
public function getPrestaAnnConsigneePlanned(): ?string
{
return $this->presta_ann_consignee_planned;
}
public function setPrestaAnnConsigneePlanned(string $presta_ann_consignee_planned): self
{
$this->presta_ann_consignee_planned = $presta_ann_consignee_planned;
return $this;
}
public function getAttachedDocs(): ?string
{
return $this->attached_docs;
}
public function setAttachedDocs(string $attached_docs): self
{
$this->attached_docs = $attached_docs;
return $this;
}
public function getCarrier(): ?Carriers
{
return $this->carrier;
}
public function setCarrier(?Carriers $carrier): self
{
$this->carrier = $carrier;
return $this;
}
public function getPlannedAt(): ?\DateTimeInterface
{
return $this->planned_at;
}
public function setPlannedAt(?\DateTimeInterface $planned_at): self
{
$this->planned_at = $planned_at;
return $this;
}
public function getPalletEurope(): ?bool
{
return $this->pallet_europe;
}
public function setPalletEurope(?bool $pallet_europe): self
{
$this->pallet_europe = $pallet_europe;
return $this;
}
public function getPalletOther(): ?string
{
return $this->pallet_other;
}
public function setPalletOther(?string $pallet_other): self
{
$this->pallet_other = $pallet_other;
return $this;
}
public function getPallet80120(): ?bool
{
return $this->pallet_80_120;
}
public function setPallet80120(?bool $pallet_80_120): self
{
$this->pallet_80_120 = $pallet_80_120;
return $this;
}
public function getPallet100120(): ?bool
{
return $this->pallet_100_120;
}
public function setPallet100120(?bool $pallet_100_120): self
{
$this->pallet_100_120 = $pallet_100_120;
return $this;
}
/**
* @return Collection|TaskDriver[]
*/
public function getTaskDrivers(): Collection
{
return $this->task_drivers;
}
public function addTaskDrivers(TaskDriver $taskDriver): self
{
if (!$this->task_drivers->contains($taskDriver)) {
$this->task_drivers[] = $taskDriver;
$taskDriver->setTasks($this);
}
return $this;
}
public function removeTaskDrivers(TaskDriver $taskDriver): self
{
if ($this->task_drivers->removeElement($taskDriver)) {
// set the owning side to null (unless already changed)
if ($taskDriver->getTasks() === $this) {
$taskDriver->setTasks(null);
}
}
return $this;
}
/**
* @return Collection|TaskVehicule[]
*/
public function getTaskVehicules(): Collection
{
return $this->task_vehicules;
}
public function addTaskVehciule(TaskVehicule $taskVehicule): self
{
if (!$this->task_vehicules->contains($taskVehicule)) {
$this->task_vehicules[] = $taskVehicule;
$taskVehicule->setTasks($this);
}
return $this;
}
public function removeTaskVehicule(TaskVehicule $taskVehicule): self
{
if ($this->task_vehicules->removeElement($taskVehicule)) {
// set the owning side to null (unless already changed)
if ($taskVehicule->getTasks() === $this) {
$taskVehicule->setTasks(null);
}
}
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): static
{
$this->createdBy = $createdBy;
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, Upload>
*/
public function getUploads(): Collection
{
return $this->uploads;
}
public function addUpload(Upload $upload): static
{
if (!$this->uploads->contains($upload)) {
$this->uploads->add($upload);
$upload->setTask($this);
}
return $this;
}
public function removeUpload(Upload $upload): static
{
if ($this->uploads->removeElement($upload)) {
// set the owning side to null (unless already changed)
if ($upload->getTask() === $this) {
$upload->setTask(null);
}
}
return $this;
}
/**
* @return Collection<int, TaskTracking>
*/
public function getTaskTrackings(): Collection
{
return $this->taskTrackings;
}
public function addTaskTracking(TaskTracking $taskTracking): static
{
if (!$this->taskTrackings->contains($taskTracking)) {
$this->taskTrackings->add($taskTracking);
$taskTracking->setTask($this);
}
return $this;
}
public function removeTaskTracking(TaskTracking $taskTracking): static
{
if ($this->taskTrackings->removeElement($taskTracking)) {
// set the owning side to null (unless already changed)
if ($taskTracking->getTask() === $this) {
$taskTracking->setTask(null);
}
}
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->setTask($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->getTask() === $this) {
$litige->setTask(null);
}
}
return $this;
}
/**
* @return Collection<int, TourneeTask>
*/
public function getTourneeTasks(): Collection
{
return $this->tourneeTasks;
}
public function addTourneeTask(TourneeTask $tourneeTask): static
{
if (!$this->tourneeTasks->contains($tourneeTask)) {
$this->tourneeTasks->add($tourneeTask);
$tourneeTask->setTask($this);
}
return $this;
}
public function removeTourneeTask(TourneeTask $tourneeTask): static
{
if ($this->tourneeTasks->removeElement($tourneeTask)) {
// set the owning side to null (unless already changed)
if ($tourneeTask->getTask() === $this) {
$tourneeTask->setTask(null);
}
}
return $this;
}
public function isIsTourneeAssociated(): ?bool
{
return $this->is_tournee_associated;
}
public function setIsTourneeAssociated(bool $is_tournee_associated): static
{
$this->is_tournee_associated = $is_tournee_associated;
return $this;
}
}