src/Entity/AdminFinance/Vehicule/Voiture.php line 16

  1. <?php
  2. namespace App\Entity\AdminFinance\Vehicule;
  3. use App\Repository\AdminFinance\Vehicule\VoitureRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Table(name="vehicule_voiture")
  10.  * @ORM\Entity(repositoryClass=VoitureRepository::class)
  11.  */
  12. #[ORM\Table(name:'vehicule_voiture')]
  13. #[ORM\Entity(repositoryClassVoitureRepository::class)]
  14. class Voiture
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length50)]
  21.     private ?string $libelle null;
  22.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  23.     private ?\DateTimeInterface $dateAchat null;
  24.     #[ORM\Column]
  25.     private ?float $prixAchat null;
  26.     
  27.     #[ORM\Column]
  28.     private ?float $prixActuel null;
  29.     #[ORM\Column]
  30.     private ?int $kmInitial null;
  31.     #[ORM\OneToMany(targetEntity:VehiculeMouvement::class, mappedBy'voiture')]
  32.     private $mouvements;
  33.     public function __construct()
  34.     {
  35.         $this->mouvements = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getLibelle(): ?string
  42.     {
  43.         return $this->libelle;
  44.     }
  45.     public function setLibelle(string $libelle): self
  46.     {
  47.         $this->libelle $libelle;
  48.         return $this;
  49.     }
  50.     public function getDateAchat(): ?\DateTimeInterface
  51.     {
  52.         return $this->dateAchat;
  53.     }
  54.     public function setDateAchat(\DateTimeInterface $dateAchat): self
  55.     {
  56.         $this->dateAchat $dateAchat;
  57.         return $this;
  58.     }
  59.     public function getPrixAchat(): ?float
  60.     {
  61.         return $this->prixAchat;
  62.     }
  63.     public function setPrixAchat(float $prixAchat): self
  64.     {
  65.         $this->prixAchat $prixAchat;
  66.         return $this;
  67.     }
  68.     
  69.     public function getPrixActuel(): ?float
  70.     {
  71.         return $this->prixActuel;
  72.     }
  73.     public function setPrixActuel(float $prixActuel): self
  74.     {
  75.         $this->prixActuel $prixActuel;
  76.         return $this;
  77.     }
  78.     public function getKmInitial(): ?int
  79.     {
  80.         return $this->kmInitial;
  81.     }
  82.     public function setKmInitial(int $kmInitial): self
  83.     {
  84.         $this->kmInitial $kmInitial;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection|VehiculeMouvement[]
  89.      */
  90.     public function getVehiculeMouvements(): Collection
  91.     {
  92.         return $this->mouvements;
  93.     }
  94.     public function addVehiculeMouvement(VehiculeMouvement $mouvement): self
  95.     {
  96.         if (!$this->mouvements->contains($mouvement)) {
  97.             $this->mouvements[] = $mouvement;
  98.             $mouvement->setVoiture($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeVehiculeMouvement(VehiculeMouvement $mouvement): self
  103.     {
  104.         if ($this->mouvements->contains($mouvement)) {
  105.             $this->mouvements->removeElement($mouvement);
  106.             // set the owning side to null (unless already changed)
  107.             if ($mouvement->getVoiture() === $this) {
  108.                 $mouvement->setVoiture(null);
  109.             }
  110.         }
  111.         return $this;
  112.     }
  113.     /**
  114.      * @return Collection<int, VehiculeMouvement>
  115.      */
  116.     public function getMouvements(): Collection
  117.     {
  118.         return $this->mouvements;
  119.     }
  120.     public function addMouvement(VehiculeMouvement $mouvement): self
  121.     {
  122.         if (!$this->mouvements->contains($mouvement)) {
  123.             $this->mouvements->add($mouvement);
  124.             $mouvement->setVoiture($this);
  125.         }
  126.         return $this;
  127.     }
  128.     public function removeMouvement(VehiculeMouvement $mouvement): self
  129.     {
  130.         if ($this->mouvements->removeElement($mouvement)) {
  131.             // set the owning side to null (unless already changed)
  132.             if ($mouvement->getVoiture() === $this) {
  133.                 $mouvement->setVoiture(null);
  134.             }
  135.         }
  136.         return $this;
  137.     }
  138. }