<?php
// src/Entity/DeclarationLigne.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="declaration_ligne", indexes={
* @ORM\Index(name="idx_date", columns={"date_jour"}),
* @ORM\Index(name="idx_immat", columns={"immatriculation"}),
* @ORM\Index(name="idx_client", columns={"nom_client"}),
* @ORM\Index(name="idx_corrected", columns={"is_corrected"})
* })
*/
class DeclarationLigne
{
/**
* @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=DeclarationConducteur::class, inversedBy="lignes")
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*/
private ?DeclarationConducteur $declaration = null;
// Répétition volontaire → ultra rapide
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private ?string $agence = null;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $immatriculation = null;
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private ?string $nom_client = null;
/**
* @ORM\Column(type="date", nullable=true) // ← MODIFIER ICI : ajouter nullable=true
*/
private ?\DateTimeInterface $date_jour = null; // ← MODIFIER ICI : initialiser à null
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private ?string $lieu_depart = null;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private ?string $km_depart = null;
// Tranches horaires - CORRIGE CES PROPRIÉTÉS (il manque les annotations @ORM\Column)
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_1_matin_debut = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_1_matin_fin = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_2_midi_debut = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_2_midi_fin = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_3_soir_debut = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_3_soir_fin = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_4_autre_debut = null;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private ?string $tranche_4_autre_fin = null;
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private ?string $lieu_arrivee = null;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private ?string $km_arrivee = null;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $temps_annexes = null;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $temps_total = null;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $commentaires = null;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $is_corrected = false;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private ?\DateTimeImmutable $corrected_at = null;
// ───── TOUS LES GETTERS & SETTERS ─────
public function getId(): ?int { return $this->id; }
public function getDeclaration(): ?DeclarationConducteur { return $this->declaration; }
public function setDeclaration(?DeclarationConducteur $d): self { $this->declaration = $d; return $this; }
public function getAgence(): ?string { return $this->agence; }
public function setAgence(?string $v): self { $this->agence = $v; return $this; }
public function getImmatriculation(): ?string { return $this->immatriculation; }
public function setImmatriculation(?string $v): self { $this->immatriculation = $v; return $this; }
public function getNomClient(): ?string { return $this->nom_client; }
public function setNomClient(?string $v): self { $this->nom_client = $v; return $this; }
// MODIFIER LES GETTER ET SETTER POUR date_jour :
public function getDateJour(): ?\DateTimeInterface { return $this->date_jour; } // ← Retour nullable
public function setDateJour(?\DateTimeInterface $v): self { $this->date_jour = $v; return $this; } // ← Paramètre nullable
public function getLieuDepart(): ?string { return $this->lieu_depart; }
public function setLieuDepart(?string $v): self { $this->lieu_depart = $v; return $this; }
public function getKmDepart(): ?string { return $this->km_depart; }
public function setKmDepart(?string $v): self { $this->km_depart = $v; return $this; }
// Tranches
public function getTranche1MatinDebut(): ?string { return $this->tranche_1_matin_debut; }
public function setTranche1MatinDebut(?string $v): self { $this->tranche_1_matin_debut = $v; return $this; }
public function getTranche1MatinFin(): ?string { return $this->tranche_1_matin_fin; }
public function setTranche1MatinFin(?string $v): self { $this->tranche_1_matin_fin = $v; return $this; }
public function getTranche2MidiDebut(): ?string { return $this->tranche_2_midi_debut; }
public function setTranche2MidiDebut(?string $v): self { $this->tranche_2_midi_debut = $v; return $this; }
public function getTranche2MidiFin(): ?string { return $this->tranche_2_midi_fin; }
public function setTranche2MidiFin(?string $v): self { $this->tranche_2_midi_fin = $v; return $this; }
public function getTranche3SoirDebut(): ?string { return $this->tranche_3_soir_debut; }
public function setTranche3SoirDebut(?string $v): self { $this->tranche_3_soir_debut = $v; return $this; }
public function getTranche3SoirFin(): ?string { return $this->tranche_3_soir_fin; }
public function setTranche3SoirFin(?string $v): self { $this->tranche_3_soir_fin = $v; return $this; }
public function getTranche4AutreDebut(): ?string { return $this->tranche_4_autre_debut; }
public function setTranche4AutreDebut(?string $v): self { $this->tranche_4_autre_debut = $v; return $this; }
public function getTranche4AutreFin(): ?string { return $this->tranche_4_autre_fin; }
public function setTranche4AutreFin(?string $v): self { $this->tranche_4_autre_fin = $v; return $this; }
public function getLieuArrivee(): ?string { return $this->lieu_arrivee; }
public function setLieuArrivee(?string $v): self { $this->lieu_arrivee = $v; return $this; }
public function getKmArrivee(): ?string { return $this->km_arrivee; }
public function setKmArrivee(?string $v): self { $this->km_arrivee = $v; return $this; }
public function getTempsAnnexes(): ?string { return $this->temps_annexes; }
public function setTempsAnnexes(?string $v): self { $this->temps_annexes = $v; return $this; }
public function getTempsTotal(): ?string { return $this->temps_total; }
public function setTempsTotal(?string $v): self { $this->temps_total = $v; return $this; }
public function getCommentaires(): ?string { return $this->commentaires; }
public function setCommentaires(?string $v): self { $this->commentaires = $v; return $this; }
public function isCorrected(): bool { return $this->is_corrected; }
public function setIsCorrected(bool $v): self { $this->is_corrected = $v; return $this; }
public function getCorrectedAt(): ?\DateTimeImmutable { return $this->corrected_at; }
public function setCorrectedAt(?\DateTimeImmutable $v): self { $this->corrected_at = $v; return $this; }
}