src/Entity/DeclarationLigne.php line 17

Open in your IDE?
  1. <?php
  2. // src/Entity/DeclarationLigne.php
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity
  7.  * @ORM\Table(name="declaration_ligne", indexes={
  8.  *     @ORM\Index(name="idx_date", columns={"date_jour"}),
  9.  *     @ORM\Index(name="idx_immat", columns={"immatriculation"}),
  10.  *     @ORM\Index(name="idx_client", columns={"nom_client"}),
  11.  *     @ORM\Index(name="idx_corrected", columns={"is_corrected"})
  12.  * })
  13.  */
  14. class DeclarationLigne
  15. {
  16.     /**
  17.      * @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer")
  18.      */
  19.     private ?int $id null;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=DeclarationConducteur::class, inversedBy="lignes")
  22.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  23.      */
  24.     private ?DeclarationConducteur $declaration null;
  25.     // Répétition volontaire → ultra rapide
  26.     /**
  27.      * @ORM\Column(type="string", length=150, nullable=true)
  28.      */
  29.     private ?string $agence null;
  30.     /**
  31.      * @ORM\Column(type="string", length=50, nullable=true)
  32.      */
  33.     private ?string $immatriculation null;
  34.     /**
  35.      * @ORM\Column(type="string", length=150, nullable=true)
  36.      */
  37.     private ?string $nom_client null;
  38.     /**
  39.      * @ORM\Column(type="date", nullable=true)  // ← MODIFIER ICI : ajouter nullable=true
  40.      */
  41.     private ?\DateTimeInterface $date_jour null;  // ← MODIFIER ICI : initialiser à null
  42.     /**
  43.      * @ORM\Column(type="string", length=150, nullable=true)
  44.      */
  45.     private ?string $lieu_depart null;
  46.     /**
  47.      * @ORM\Column(type="string", length=20, nullable=true)
  48.      */
  49.     private ?string $km_depart null;
  50.     // Tranches horaires - CORRIGE CES PROPRIÉTÉS (il manque les annotations @ORM\Column)
  51.     /**
  52.      * @ORM\Column(type="string", length=10, nullable=true)
  53.      */
  54.     private ?string $tranche_1_matin_debut null;
  55.     
  56.     /**
  57.      * @ORM\Column(type="string", length=10, nullable=true)
  58.      */
  59.     private ?string $tranche_1_matin_fin null;
  60.     
  61.     /**
  62.      * @ORM\Column(type="string", length=10, nullable=true)
  63.      */
  64.     private ?string $tranche_2_midi_debut null;
  65.     
  66.     /**
  67.      * @ORM\Column(type="string", length=10, nullable=true)
  68.      */
  69.     private ?string $tranche_2_midi_fin null;
  70.     
  71.     /**
  72.      * @ORM\Column(type="string", length=10, nullable=true)
  73.      */
  74.     private ?string $tranche_3_soir_debut null;
  75.     
  76.     /**
  77.      * @ORM\Column(type="string", length=10, nullable=true)
  78.      */
  79.     private ?string $tranche_3_soir_fin null;
  80.     
  81.     /**
  82.      * @ORM\Column(type="string", length=10, nullable=true)
  83.      */
  84.     private ?string $tranche_4_autre_debut null;
  85.     
  86.     /**
  87.      * @ORM\Column(type="string", length=10, nullable=true)
  88.      */
  89.     private ?string $tranche_4_autre_fin null;
  90.     /**
  91.      * @ORM\Column(type="string", length=150, nullable=true)
  92.      */
  93.     private ?string $lieu_arrivee null;
  94.     /**
  95.      * @ORM\Column(type="string", length=20, nullable=true)
  96.      */
  97.     private ?string $km_arrivee null;
  98.     /**
  99.      * @ORM\Column(type="string", length=50, nullable=true)
  100.      */
  101.     private ?string $temps_annexes null;
  102.     /**
  103.      * @ORM\Column(type="string", length=50, nullable=true)
  104.      */
  105.     private ?string $temps_total null;
  106.     /**
  107.      * @ORM\Column(type="text", nullable=true)
  108.      */
  109.     private ?string $commentaires null;
  110.     /**
  111.      * @ORM\Column(type="boolean", options={"default": false})
  112.      */
  113.     private bool $is_corrected false;
  114.     /**
  115.      * @ORM\Column(type="datetime_immutable", nullable=true)
  116.      */
  117.     private ?\DateTimeImmutable $corrected_at null;
  118.     // ───── TOUS LES GETTERS & SETTERS ─────
  119.     public function getId(): ?int { return $this->id; }
  120.     public function getDeclaration(): ?DeclarationConducteur { return $this->declaration; }
  121.     public function setDeclaration(?DeclarationConducteur $d): self $this->declaration $d; return $this; }
  122.     public function getAgence(): ?string { return $this->agence; }
  123.     public function setAgence(?string $v): self $this->agence $v; return $this; }
  124.     public function getImmatriculation(): ?string { return $this->immatriculation; }
  125.     public function setImmatriculation(?string $v): self $this->immatriculation $v; return $this; }
  126.     public function getNomClient(): ?string { return $this->nom_client; }
  127.     public function setNomClient(?string $v): self $this->nom_client $v; return $this; }
  128.     // MODIFIER LES GETTER ET SETTER POUR date_jour :
  129.     public function getDateJour(): ?\DateTimeInterface { return $this->date_jour; }  // ← Retour nullable
  130.     public function setDateJour(?\DateTimeInterface $v): self $this->date_jour $v; return $this; }  // ← Paramètre nullable
  131.     public function getLieuDepart(): ?string { return $this->lieu_depart; }
  132.     public function setLieuDepart(?string $v): self $this->lieu_depart $v; return $this; }
  133.     public function getKmDepart(): ?string { return $this->km_depart; }
  134.     public function setKmDepart(?string $v): self $this->km_depart $v; return $this; }
  135.     // Tranches
  136.     public function getTranche1MatinDebut(): ?string { return $this->tranche_1_matin_debut; }
  137.     public function setTranche1MatinDebut(?string $v): self $this->tranche_1_matin_debut $v; return $this; }
  138.     
  139.     public function getTranche1MatinFin(): ?string { return $this->tranche_1_matin_fin; }
  140.     public function setTranche1MatinFin(?string $v): self $this->tranche_1_matin_fin $v; return $this; }
  141.     public function getTranche2MidiDebut(): ?string { return $this->tranche_2_midi_debut; }
  142.     public function setTranche2MidiDebut(?string $v): self $this->tranche_2_midi_debut $v; return $this; }
  143.     
  144.     public function getTranche2MidiFin(): ?string { return $this->tranche_2_midi_fin; }
  145.     public function setTranche2MidiFin(?string $v): self $this->tranche_2_midi_fin $v; return $this; }
  146.     public function getTranche3SoirDebut(): ?string { return $this->tranche_3_soir_debut; }
  147.     public function setTranche3SoirDebut(?string $v): self $this->tranche_3_soir_debut $v; return $this; }
  148.     
  149.     public function getTranche3SoirFin(): ?string { return $this->tranche_3_soir_fin; }
  150.     public function setTranche3SoirFin(?string $v): self $this->tranche_3_soir_fin $v; return $this; }
  151.     public function getTranche4AutreDebut(): ?string { return $this->tranche_4_autre_debut; }
  152.     public function setTranche4AutreDebut(?string $v): self $this->tranche_4_autre_debut $v; return $this; }
  153.     
  154.     public function getTranche4AutreFin(): ?string { return $this->tranche_4_autre_fin; }
  155.     public function setTranche4AutreFin(?string $v): self $this->tranche_4_autre_fin $v; return $this; }
  156.     public function getLieuArrivee(): ?string { return $this->lieu_arrivee; }
  157.     public function setLieuArrivee(?string $v): self $this->lieu_arrivee $v; return $this; }
  158.     public function getKmArrivee(): ?string { return $this->km_arrivee; }
  159.     public function setKmArrivee(?string $v): self $this->km_arrivee $v; return $this; }
  160.     public function getTempsAnnexes(): ?string { return $this->temps_annexes; }
  161.     public function setTempsAnnexes(?string $v): self $this->temps_annexes $v; return $this; }
  162.     public function getTempsTotal(): ?string { return $this->temps_total; }
  163.     public function setTempsTotal(?string $v): self $this->temps_total $v; return $this; }
  164.     public function getCommentaires(): ?string { return $this->commentaires; }
  165.     public function setCommentaires(?string $v): self $this->commentaires $v; return $this; }
  166.     public function isCorrected(): bool { return $this->is_corrected; }
  167.     public function setIsCorrected(bool $v): self $this->is_corrected $v; return $this; }
  168.     public function getCorrectedAt(): ?\DateTimeImmutable { return $this->corrected_at; }
  169.     public function setCorrectedAt(?\DateTimeImmutable $v): self $this->corrected_at $v; return $this; }
  170. }