src/Entity/Camion.php line 13
<?phpnamespace App\Entity;use App\Repository\CamionRepository;use App\Repository\CamionUserRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CamionRepository::class)]class Camion{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 50)]private ?string $nom = null;#[ORM\Column]private ?int $actif;#[ORM\Column]private ?int $typeVehicule;#[ORM\OneToMany(mappedBy: 'camion', targetEntity: ConsommationCamion::class)]private Collection $consommationCamions;#[ORM\OneToMany(mappedBy: 'camion', targetEntity: CamionUser::class)]private Collection $camionUsers;#[ORM\OneToMany(mappedBy: 'camion', targetEntity: CartePaiement::class)]private Collection $cartePaiements;#[ORM\OneToMany(mappedBy: 'camion', targetEntity: CartePaiementCamion::class)]private Collection $cartePaiementCamions;#[ORM\OneToMany(mappedBy: 'Camion', targetEntity: Maintenance::class)]private Collection $maintenances;#[ORM\OneToMany(mappedBy: 'camion', targetEntity: Facture::class)]private Collection $factures;#[ORM\ManyToOne(inversedBy: 'camions')]private ?SystemeClient $systemeClient = null;#[ORM\Column(type: Types::DATE_MUTABLE)]private ?\DateTimeInterface $dateImmat = null;#[ORM\OneToMany(mappedBy: 'voiture', targetEntity: PlanningVoiture::class)]private Collection $planningVoitures;#[ORM\Column(length: 255)]private ?string $idSamsara = null;#[ORM\Column]private ?int $nbrEssieux = null;#[ORM\OneToMany(mappedBy: 'camion', targetEntity: PneuVehicule::class)]private Collection $pneuVehicules;#[ORM\ManyToOne(inversedBy: 'constructeur')]private ?Constructeur $constructeur = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]private ?\DateTimeInterface $finContratConstructeur = null;const TYPEVEHICULES = array(0=>'Inconnu',1=>'Tracteur',2=>'Voiture');public function __construct(){$this->consommationCamions = new ArrayCollection();$this->camionUsers = new ArrayCollection();$this->cartePaiements = new ArrayCollection();$this->cartePaiementCamions = new ArrayCollection();$this->maintenances = new ArrayCollection();$this->factures = new ArrayCollection();$this->planningVoitures = new ArrayCollection();$this->pneuVehicules = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getNom(): ?string{return $this->nom;}public function setNom(string $nom): self{$this->nom = $nom;return $this;}/*** @return Collection<int, ConsommationCamion>*/public function getConsommationCamions(): Collection{return $this->consommationCamions;}public function addConsommationCamion(ConsommationCamion $consommationCamion): self{if (!$this->consommationCamions->contains($consommationCamion)) {$this->consommationCamions->add($consommationCamion);$consommationCamion->setCamion($this);}return $this;}public function removeConsommationCamion(ConsommationCamion $consommationCamion): self{if ($this->consommationCamions->removeElement($consommationCamion)) {// set the owning side to null (unless already changed)if ($consommationCamion->getCamion() === $this) {$consommationCamion->setCamion(null);}}return $this;}public function getActif(): ?int{return $this->actif;}public function setActif(int $actif): self{$this->actif = $actif;return $this;}public function getTypeVehicule(): ?int{return $this->typeVehicule;}public function getIconeTypeVehicule(){if($this->typeVehicule == 1){echo "<i class=\"fa-solid fa-truck-moving\"></i>";}else if($this->typeVehicule == 2){echo"<i class=\"fa-solid fa-car-side\"></i>";}else{echo "<i class=\"fa-solid fa-question\"></i>";}}public function setTypeVehicule(int $typeVehicule): self{$this->typeVehicule = $typeVehicule;return $this;}public function getUserByDate($date): ?User{if(!empty($this->getCamionUsers())){}return $this->user;}/*** @return Collection<int, ConsommationCamion>*/public function getCamionUsers(): Collection{return $this->camionUsers;}public function __toString(){return $this->getNom();}/*** @return Collection<int, CartePaiement>*/public function getCartePaiements(): Collection{return $this->cartePaiements;}public function addCartePaiement(CartePaiement $cartePaiement): self{if (!$this->cartePaiements->contains($cartePaiement)) {$this->cartePaiements->add($cartePaiement);$cartePaiement->setCamion($this);}return $this;}public function removeCartePaiement(CartePaiement $cartePaiement): self{if ($this->cartePaiements->removeElement($cartePaiement)) {// set the owning side to null (unless already changed)if ($cartePaiement->getCamion() === $this) {$cartePaiement->setCamion(null);}}return $this;}/*** @return Collection<int, CartePaiementCamion>*/public function getCartePaiementCamions(): Collection{return $this->cartePaiementCamions;}public function addCartePaiementCamion(CartePaiementCamion $cartePaiementCamion): self{if (!$this->cartePaiementCamions->contains($cartePaiementCamion)) {$this->cartePaiementCamions->add($cartePaiementCamion);$cartePaiementCamion->setCamion($this);}return $this;}public function removeCartePaiementCamion(CartePaiementCamion $cartePaiementCamion): self{if ($this->cartePaiementCamions->removeElement($cartePaiementCamion)) {// set the owning side to null (unless already changed)if ($cartePaiementCamion->getCamion() === $this) {$cartePaiementCamion->setCamion(null);}}return $this;}/*** @return Collection<int, CartePaiementCamion>*/public function getCartePaiementByDate($date): Collection{return $this->cartePaiementCamions;}/*** @return Collection<int, Maintenance>*/public function getMaintenances(): Collection{return $this->maintenances;}public function addMaintenance(Maintenance $maintenance): self{if (!$this->maintenances->contains($maintenance)) {$this->maintenances->add($maintenance);$maintenance->setCamion($this);}return $this;}public function removeMaintenance(Maintenance $maintenance): self{if ($this->maintenances->removeElement($maintenance)) {// set the owning side to null (unless already changed)if ($maintenance->getCamion() === $this) {$maintenance->setCamion(null);}}return $this;}/*** @return Collection<int, Facture>*/public function getFactures(): Collection{return $this->factures;}public function addFacture(Facture $facture): self{if (!$this->factures->contains($facture)) {$this->factures->add($facture);$facture->setCamion($this);}return $this;}public function removeFacture(Facture $facture): self{if ($this->factures->removeElement($facture)) {// set the owning side to null (unless already changed)if ($facture->getCamion() === $this) {$facture->setCamion(null);}}return $this;}public function getSystemeClient(): ?SystemeClient{return $this->systemeClient;}public function setSystemeClient(?SystemeClient $systemeClient): self{$this->systemeClient = $systemeClient;return $this;}public function getDateImmat(): ?\DateTimeInterface{return $this->dateImmat;}public function setDateImmat(\DateTimeInterface $dateImmat): self{$this->dateImmat = $dateImmat;return $this;}/*** @return Collection<int, PlanningVoiture>*/public function getPlanningVoitures(): Collection{return $this->planningVoitures;}public function addPlanningVoiture(PlanningVoiture $planningVoiture): self{if (!$this->planningVoitures->contains($planningVoiture)) {$this->planningVoitures->add($planningVoiture);$planningVoiture->setVoiture($this);}return $this;}public function removePlanningVoiture(PlanningVoiture $planningVoiture): self{if ($this->planningVoitures->removeElement($planningVoiture)) {// set the owning side to null (unless already changed)if ($planningVoiture->getVoiture() === $this) {$planningVoiture->setVoiture(null);}}return $this;}public function getIdSamsara(): ?string{return $this->idSamsara;}public function setIdSamsara(string $idSamsara): static{$this->idSamsara = $idSamsara;return $this;}public function getNbrEssieux(): ?int{return $this->nbrEssieux;}public function setNbrEssieux(int $nbrEssieux): static{$this->nbrEssieux = $nbrEssieux;return $this;}/*** @return Collection<int, PneuVehicule>*/public function getPneuVehicules(): Collection{return $this->pneuVehicules;}public function addPneuVehicule(PneuVehicule $pneuVehicule): static{if (!$this->pneuVehicules->contains($pneuVehicule)) {$this->pneuVehicules->add($pneuVehicule);$pneuVehicule->setCamion($this);}return $this;}public function removePneuVehicule(PneuVehicule $pneuVehicule): static{if ($this->pneuVehicules->removeElement($pneuVehicule)) {// set the owning side to null (unless already changed)if ($pneuVehicule->getCamion() === $this) {$pneuVehicule->setCamion(null);}}return $this;}public function getConstructeur(): ?Constructeur{return $this->constructeur;}public function setConstructeur(?Constructeur $constructeur): static{$this->constructeur = $constructeur;return $this;}public function getFinContratConstructeur(): ?\DateTimeInterface{return $this->finContratConstructeur;}public function setFinContratConstructeur(?\DateTimeInterface $finContratConstructeur): static{$this->finContratConstructeur = $finContratConstructeur;return $this;}}