src/Entity/DeclarationChauffeur.php line 10
<?phpnamespace App\Entity;use App\Repository\DeclarationChauffeurRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: DeclarationChauffeurRepository::class)]class DeclarationChauffeur{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(type: Types::DATE_MUTABLE)]private ?\DateTimeInterface $date = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $heureDepart = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $heureArrivee = null;#[ORM\ManyToOne]private ?VilleFrance $villeDepart = null;#[ORM\ManyToOne]private ?VilleFrance $villeArrivee = null;#[ORM\Column]private ?bool $pdj = null;#[ORM\Column]private ?bool $rmidi = null;#[ORM\Column]private ?bool $rsoir = null;#[ORM\Column]private ?bool $rgd = null;#[ORM\Column]private ?bool $rnuit = null;#[ORM\ManyToOne]private ?User $user = null;#[ORM\Column]private ?int $retourVoiture = null;#[ORM\Column]private ?int $interr = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $amp = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $serv = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $cond = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $trav = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $coup = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $heureNuit = null;#[ORM\Column]private ?int $i = null;#[ORM\Column(type: Types::TIME_MUTABLE)]private ?\DateTimeInterface $av = null;#[ORM\Column(type: Types::DATE_MUTABLE)]private ?\DateTimeInterface $created = null;#[ORM\Column(type: Types::TIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $heureVoitureAvant = null;#[ORM\Column(type: Types::TIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $heureVoitureApres = null;/*** DeclarationChauffeur constructor.*/public function __construct($date,$user){$this->date = $date;$this->user = $user;}public function getId(): ?int{return $this->id;}public function getDate(): ?\DateTimeInterface{return $this->date;}public function setDate(\DateTimeInterface $date): self{$this->date = $date;return $this;}public function getHeureDepartDate(): ?\DateTimeInterface{$dateHeure = new \DateTime($this->date->format('Y-m-d').' '.$this->heureDepart->format('H:i:s'));return $dateHeure;}public function getHeureDepart(): ?\DateTimeInterface{return $this->heureDepart;}public function setHeureDepart(\DateTimeInterface $heureDepart): self{$this->heureDepart = $heureDepart;return $this;}public function getHeureArriveeDate(): ?\DateTimeInterface{/*var_dump($this->heureDepart);var_dump($this->heureArrivee);*/if($this->heureDepart->format('H') < $this->heureArrivee->format('H')){$dateHeure = new \DateTime($this->date->format('Y-m-d').' '.$this->heureArrivee->format('H:i:s'));}else{/*echo 'ok';var_dump($this->getId());var_dump($this->date);*/$date = clone $this->date;$date = $date->modify('+1 days');//var_dump($date);$dateHeure = new \DateTime($date->format('Y-m-d').' '.$this->heureArrivee->format('H:i:s'));}return $dateHeure;}public function getHeureArrivee(): ?\DateTimeInterface{return $this->heureArrivee;}public function setHeureArrivee(\DateTimeInterface $heureArrivee): self{$this->heureArrivee = $heureArrivee;return $this;}public function getVilleDepart(): ?VilleFrance{return $this->villeDepart;}public function setVilleDepart(VilleFrance $villeDepart): self{$this->villeDepart = $villeDepart;return $this;}public function getVilleArrivee(): ?VilleFrance{return $this->villeArrivee;}public function setVilleArrivee(VilleFrance $villeArrivee): self{$this->villeArrivee = $villeArrivee;return $this;}public function getPdj(): ?bool{return $this->pdj;}public function setPdj(bool $pdj): self{$this->pdj = $pdj;return $this;}public function getRmidi(): ?bool{return $this->rmidi;}public function setRmidi(bool $rmidi): self{$this->rmidi = $rmidi;return $this;}public function getRgd(): ?bool{return $this->rgd;}public function setRgd(bool $rgd): self{$this->rgd = $rgd;return $this;}public function getRnuit(): ?bool{return $this->rnuit;}public function setRnuit(bool $rnuit): self{$this->rnuit = $rnuit;return $this;}public function getRsoir(): ?bool{return $this->rsoir;}public function setRsoir(bool $rsoir): self{$this->rsoir = $rsoir;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(User $user): self{$this->user = $user;return $this;}public function getRetourVoiture(): ?int{return $this->retourVoiture;}public function setRetourVoiture(int $retourVoiture): self{$this->retourVoiture = $retourVoiture;return $this;}public function getInterr(): ?int{return $this->interr;}public function setInterr(int $interr): static{$this->interr = $interr;return $this;}public function getAmp(): ?\DateTimeInterface{if ($this->amp === null) {return new \DateTime('00:00:00');}return $this->amp;}public function setAmp(\DateTimeInterface $amp): static{$this->amp = $amp;return $this;}public function getServ(): ?\DateTimeInterface{if ($this->serv === null) {return new \DateTime('00:00:00');}return $this->serv;}public function setServ(\DateTimeInterface $serv): static{$this->serv = $serv;return $this;}public function getCond(): ?\DateTimeInterface{if ($this->cond === null) {return new \DateTime('00:00:00');}return $this->cond;}public function setCond(\DateTimeInterface $cond): static{$this->cond = $cond;return $this;}public function getTrav(): ?\DateTimeInterface{if ($this->trav === null) {return new \DateTime('00:00:00');}return $this->trav;}public function setTrav(\DateTimeInterface $trav): static{$this->trav = $trav;return $this;}public function getCoup(): ?\DateTimeInterface{if ($this->coup === null) {return new \DateTime('00:00:00');}return $this->coup;}public function setCoup(\DateTimeInterface $coup): static{$this->coup = $coup;return $this;}public function getHeureNuit(): ?\DateTimeInterface{if ($this->heureNuit === null) {return new \DateTime('00:00:00');}return $this->heureNuit;}public function setHeureNuit(\DateTimeInterface $heureNuit): static{$this->heureNuit = $heureNuit;return $this;}public function getI(): ?int{return $this->i;}public function setI(int $i): static{$this->i = $i;return $this;}public function getAv(): ?\DateTimeInterface{if ($this->av === null) {return new \DateTime('00:00:00');}return $this->av;}public function setAv(\DateTimeInterface $av): static{$this->av = $av;return $this;}public function getCreated(): ?\DateTimeInterface{return $this->created;}public function setCreated(\DateTimeInterface $created): static{$this->created = $created;return $this;}public function getHeureVoitureAvant(): ?\DateTimeInterface{return $this->heureVoitureAvant;}public function setHeureVoitureAvant(?\DateTimeInterface $heureVoitureAvant): static{$this->heureVoitureAvant = $heureVoitureAvant;return $this;}public function getHeureVoitureApres(): ?\DateTimeInterface{return $this->heureVoitureApres;}public function setHeureVoitureApres(?\DateTimeInterface $heureVoitureApres): static{$this->heureVoitureApres = $heureVoitureApres;return $this;}}