src\Entity\Souscription.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SouscriptionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassSouscriptionRepository::class)]
  6. class Souscription
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'integer')]
  13.     private $quantite;
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'souscriptions')]
  16.     private $user;
  17.     #[ORM\Column(type'datetime')]
  18.     private $created_at;
  19.     #[ORM\Column(type'datetime'nullabletrue)]
  20.     private $validated_at;
  21.     #[ORM\Column(type'datetime'nullabletrue)]
  22.     private $started_at;
  23.     #[ORM\Column(type'datetime'nullabletrue)]
  24.     private $end_at;
  25.     #[ORM\Column(type'datetime'nullabletrue)]
  26.     private $cancelled_at;
  27.     #[ORM\ManyToOne(targetEntityFacture::class, inversedBy'souscriptions')]
  28.     private $facture;
  29.     #[ORM\ManyToOne(targetEntityPackage::class, inversedBy'souscriptions')]
  30.     private $package;
  31.     #[ORM\ManyToOne(targetEntityProgrammeFormation::class, inversedBy'souscriptions')]
  32.     private $programme_formation;
  33.     #[ORM\Column(type'string'length255)]
  34.     private $titre;
  35.     #[ORM\Column(type'float'nullabletrue)]
  36.     private $prix;
  37.     #[ORM\Column(type'integer')]
  38.     private $status;
  39.     const FULL_STATUS =['non validé','validé','annulé'];
  40.     public function __construct()
  41.     {
  42.         $this->created_at = new \DateTime();
  43.         $this->status 0;
  44.     }
  45.     public function getFullStatus()
  46.     {
  47.         return self::FULL_STATUS[$this->status];
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getQuantite(): ?int
  54.     {
  55.         return $this->quantite;
  56.     }
  57.     public function setQuantite(int $quantite): self
  58.     {
  59.         $this->quantite $quantite;
  60.         return $this;
  61.     }
  62.     public function getUser(): ?User
  63.     {
  64.         return $this->user;
  65.     }
  66.     public function setUser(?User $user): self
  67.     {
  68.         $this->user $user;
  69.         return $this;
  70.     }
  71.     public function getCreatedAt(): ?\DateTimeInterface
  72.     {
  73.         return $this->created_at;
  74.     }
  75.     public function setCreatedAt(\DateTimeInterface $created_at): self
  76.     {
  77.         $this->created_at $created_at;
  78.         return $this;
  79.     }
  80.     public function getValidatedAt(): ?\DateTimeInterface
  81.     {
  82.         return $this->validated_at;
  83.     }
  84.     public function setValidatedAt(?\DateTimeInterface $validated_at): self
  85.     {
  86.         $this->validated_at $validated_at;
  87.         return $this;
  88.     }
  89.     public function getStartedAt(): ?\DateTimeInterface
  90.     {
  91.         return $this->started_at;
  92.     }
  93.     public function setStartedAt(?\DateTimeInterface $started_at): self
  94.     {
  95.         $this->started_at $started_at;
  96.         return $this;
  97.     }
  98.     public function getEndAt(): ?\DateTimeInterface
  99.     {
  100.         return $this->end_at;
  101.     }
  102.     public function setEndAt(?\DateTimeInterface $end_at): self
  103.     {
  104.         $this->end_at $end_at;
  105.         return $this;
  106.     }
  107.     public function getCancelledAt(): ?\DateTimeInterface
  108.     {
  109.         return $this->cancelled_at;
  110.     }
  111.     public function setCancelledAt(?\DateTimeInterface $cancelled_at): self
  112.     {
  113.         $this->cancelled_at $cancelled_at;
  114.         return $this;
  115.     }
  116.     public function getFacture(): ?Facture
  117.     {
  118.         return $this->facture;
  119.     }
  120.     public function setFacture(?Facture $facture): self
  121.     {
  122.         $this->facture $facture;
  123.         return $this;
  124.     }
  125.     public function getPackage(): ?Package
  126.     {
  127.         return $this->package;
  128.     }
  129.     public function setPackage(?Package $package): self
  130.     {
  131.         $this->package $package;
  132.         return $this;
  133.     }
  134.     public function getProgrammeFormation(): ?ProgrammeFormation
  135.     {
  136.         return $this->programme_formation;
  137.     }
  138.     public function setProgrammeFormation(?ProgrammeFormation $programme_formation): self
  139.     {
  140.         $this->programme_formation $programme_formation;
  141.         return $this;
  142.     }
  143.     public function getTitre(): ?string
  144.     {
  145.         return $this->titre;
  146.     }
  147.     public function setTitre(string $titre): self
  148.     {
  149.         $this->titre $titre;
  150.         return $this;
  151.     }
  152.     public function getPrix(): ?float
  153.     {
  154.         return $this->prix;
  155.     }
  156.     public function setPrix(?float $prix): self
  157.     {
  158.         $this->prix $prix;
  159.         return $this;
  160.     }
  161.     public function getStatus(): ?int
  162.     {
  163.         return $this->status;
  164.     }
  165.     public function setStatus(int $status): self
  166.     {
  167.         $this->status $status;
  168.         return $this;
  169.     }
  170. }