src/Entity/AdminFinance/Vehicule/VehiculeMouvement.php line 13

  1. <?php
  2. namespace App\Entity\AdminFinance\Vehicule;
  3. use App\Entity\AdminFinance\Bank\BankCompte;
  4. use App\Entity\AdminFinance\Bank\BankMouvementCategorie;
  5. use App\Repository\AdminFinance\Vehicule\VehiculeMouvementRepository;
  6. use Doctrine\DBAL\Types\Types;;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Table(name:'vehicule_mouvement')]
  9. #[ORM\Entity(repositoryClassVehiculeMouvementRepository::class)]
  10. class VehiculeMouvement
  11. {
  12.     CONST CATEGORY_PARENT 3;
  13.     
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  19.     private ?\DateTimeInterface $date null;
  20.     #[ORM\Column]
  21.     private ?int $km null;
  22.     #[ORM\Column]
  23.     private ?float $litre null;
  24.     #[ORM\Column]
  25.     private ?float $prixLitre null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private $commentaire;
  28.     #[ORM\Column]
  29.     private ?float $montant null;
  30.     #[ORM\Column]
  31.     private ?bool $checked;
  32.     #[ORM\ManyToOne(targetEntity:BankCompte::class, inversedBy'vehiculeMouvementDebit')]
  33.     private ?BankCompte $compteDebit null;
  34.     
  35.     #[ORM\ManyToOne(targetEntity:Voiture::class, inversedBy'mouvements')]
  36.     #[ORM\JoinColumn(nullablefalse)]
  37.     private Voiture $voiture;
  38.     
  39.     #[ORM\ManyToOne(targetEntity:BankMouvementCategorie::class)]
  40.     #[ORM\JoinColumn(nullablefalse)]
  41.     private BankMouvementCategorie $categorie;
  42.     
  43.     public function __construct() {
  44.         $this->date = new \DateTime();
  45.         $this->checked false;
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getDate(): ?\DateTimeInterface
  52.     {
  53.         return $this->date;
  54.     }
  55.     public function setDate(\DateTimeInterface $date): self
  56.     {
  57.         $this->date $date;
  58.         return $this;
  59.     }
  60.     public function getKm(): ?int
  61.     {
  62.         return $this->km;
  63.     }
  64.     public function setKm(int $km): self
  65.     {
  66.         $this->km $km;
  67.         return $this;
  68.     }
  69.     public function getLitre(): ?float
  70.     {
  71.         return $this->litre;
  72.     }
  73.     public function setLitre(float $litre): self
  74.     {
  75.         $this->litre $litre;
  76.         return $this;
  77.     }
  78.     public function getPrixLitre(): ?float
  79.     {
  80.         return $this->prixLitre;
  81.     }
  82.     public function setPrixLitre(float $prixLitre): self
  83.     {
  84.         $this->prixLitre $prixLitre;
  85.         return $this;
  86.     }
  87.     public function getCommentaire(): ?string
  88.     {
  89.         return $this->commentaire;
  90.     }
  91.     public function setCommentaire(?string $commentaire): self
  92.     {
  93.         $this->commentaire $commentaire;
  94.         return $this;
  95.     }
  96.     public function getVoiture(): ?Voiture
  97.     {
  98.         return $this->voiture;
  99.     }
  100.     public function setVoiture(?Voiture $voiture): self
  101.     {
  102.         $this->voiture $voiture;
  103.         return $this;
  104.     }
  105.     
  106.     public function getCompteDebit(): ?BankCompte
  107.     {
  108.         return $this->compteDebit;
  109.     }
  110.     public function setCompteDebit(?BankCompte $compteDebit): self
  111.     {
  112.         $this->compteDebit $compteDebit;
  113.         return $this;
  114.     }
  115.     
  116.     function getMontant() {
  117.         return $this->montant;
  118.     }
  119.     function getChecked() {
  120.         return $this->checked;
  121.     }
  122.     function setMontant($montant) {
  123.         $this->montant $montant;
  124.     }
  125.     function setChecked($checked) {
  126.         $this->checked $checked;
  127.     }
  128.     public function getClass() {
  129.         return self::class;
  130.     }
  131.     
  132.     function getCategorie() {
  133.         return $this->categorie;
  134.     }
  135.     function setCategorie($categorie) {
  136.         $this->categorie $categorie;
  137.     }
  138.     public function isChecked(): ?bool
  139.     {
  140.         return $this->checked;
  141.     }
  142. }