src/Entity/CartePaiement.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CartePaiementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCartePaiementRepository::class)]
  8. class CartePaiement
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nom null;
  16.     #[ORM\Column]
  17.     private ?int $actif;
  18.     #[ORM\OneToMany(mappedBy'cartePaiement'targetEntityCartePaiementCamion::class)]
  19.     private Collection $cartePaiementCamions;
  20.     #[ORM\Column(length20)]
  21.     private ?string $numero null;
  22.     public function __construct()
  23.     {
  24.         $this->cartePaiementCamions = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getNom(): ?string
  31.     {
  32.         return $this->nom;
  33.     }
  34.     public function setNom(string $nom): self
  35.     {
  36.         $this->nom $nom;
  37.         return $this;
  38.     }
  39.     public function __toString()
  40.     {
  41.         return $this->getNumero();
  42.     }
  43.     /**
  44.      * @return Collection<int, CartePaiementCamion>
  45.      */
  46.     public function getCartePaiementCamions(): Collection
  47.     {
  48.         return $this->cartePaiementCamions;
  49.     }
  50.     public function addCartePaiementCamion(CartePaiementCamion $cartePaiementCamion): self
  51.     {
  52.         if (!$this->cartePaiementCamions->contains($cartePaiementCamion)) {
  53.             $this->cartePaiementCamions->add($cartePaiementCamion);
  54.             $cartePaiementCamion->setCartePaiement($this);
  55.         }
  56.         return $this;
  57.     }
  58.     public function removeCartePaiementCamion(CartePaiementCamion $cartePaiementCamion): self
  59.     {
  60.         if ($this->cartePaiementCamions->removeElement($cartePaiementCamion)) {
  61.             // set the owning side to null (unless already changed)
  62.             if ($cartePaiementCamion->getCartePaiement() === $this) {
  63.                 $cartePaiementCamion->setCartePaiement(null);
  64.             }
  65.         }
  66.         return $this;
  67.     }
  68.     public function getNumero(): ?string
  69.     {
  70.         return $this->numero;
  71.     }
  72.     public function setNumero(string $numero): self
  73.     {
  74.         $this->numero $numero;
  75.         return $this;
  76.     }
  77.     public function getActif(): ?int
  78.     {
  79.         return $this->actif;
  80.     }
  81.     public function setActif(int $actif): self
  82.     {
  83.         $this->actif $actif;
  84.         return $this;
  85.     }
  86. }