src/Entity/UserEleveCreditConsommation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserEleveCreditConsommationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=UserEleveCreditConsommationRepository::class)
  9.  */
  10. class UserEleveCreditConsommation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="userEleveCreditConsommations")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $user;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=UserEleveCredit::class, inversedBy="userEleveCreditConsommations")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $credit;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=ShopCategorie::class, inversedBy="userEleveCreditConsommations")
  30.      * @ORM\JoinColumn(nullable=false)
  31.      */
  32.     private $categorie;
  33.     /**
  34.      * @ORM\Column(type="integer")
  35.      */
  36.     private $quantite;
  37.     /**
  38.      * @ORM\OneToOne(targetEntity=ActiviteDisponibiliteInscription::class, inversedBy="userEleveCreditConsommation", cascade={"persist", "remove"})
  39.      * @ORM\JoinColumn(nullable=false)
  40.      */
  41.     private $utilisation_cours;
  42.     public function __construct()
  43.     {
  44.         $this->utilisation_cours = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getUser(): ?User
  51.     {
  52.         return $this->user;
  53.     }
  54.     public function setUser(?User $user): self
  55.     {
  56.         $this->user $user;
  57.         return $this;
  58.     }
  59.     public function getCredit(): ?UserEleveCredit
  60.     {
  61.         return $this->credit;
  62.     }
  63.     public function setCredit(?UserEleveCredit $credit): self
  64.     {
  65.         $this->setCategorie($credit->getCategorie());
  66.         $this->credit $credit;
  67.         return $this;
  68.     }
  69.     public function getCategorie(): ?ShopCategorie
  70.     {
  71.         return $this->categorie;
  72.     }
  73.     public function setCategorie(?ShopCategorie $categorie): self
  74.     {
  75.         $this->categorie $categorie;
  76.         return $this;
  77.     }
  78.     public function getQuantite(): ?int
  79.     {
  80.         return $this->quantite;
  81.     }
  82.     public function setQuantite(int $quantite): self
  83.     {
  84.         $this->quantite $quantite;
  85.         return $this;
  86.     }
  87.     public function getUtilisationCours(): ?ActiviteDisponibiliteInscription
  88.     {
  89.         return $this->utilisation_cours;
  90.     }
  91.     public function setUtilisationCours(ActiviteDisponibiliteInscription $utilisation_cours): self
  92.     {
  93.         $this->utilisation_cours $utilisation_cours;
  94.         $this->setUser($utilisation_cours->getUser());
  95.         return $this;
  96.     }
  97. }