src/Entity/Offer.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OfferRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOfferRepository::class)]
  8. class Offer
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $sportLimit;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $courseLimit;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $templateLimit;
  22.     #[ORM\Column(type'boolean')]
  23.     private $hasMessaging;
  24.     #[ORM\Column(type'boolean')]
  25.     private $hasChat;
  26.     #[ORM\Column(type'boolean')]
  27.     private $hasIframeNotation;
  28.     #[ORM\Column(type'boolean')]
  29.     private $hasStats;
  30.     #[ORM\Column(type'boolean')]
  31.     private $hasStripePayment;
  32.     #[ORM\Column(type'string'length255)]
  33.     private $annualPrice;
  34.     #[ORM\Column(type'string'length255)]
  35.     private $monthlyPrice;
  36.     #[ORM\Column(type'string'length255)]
  37.     private $billing;
  38.     #[ORM\Column(type'string'length255)]
  39.     private $stripePriceId;
  40.     #[ORM\OneToMany(targetEntitySubscription::class, mappedBy'offer')]
  41.     private $subscriptions;
  42.     #[ORM\Column(type'string'length255nullabletrue)]
  43.     private $description;
  44.     #[ORM\Column(type'integer'nullabletrue)]
  45.     private $clubLimit;
  46.     #[ORM\OneToMany(targetEntityInvoice::class, mappedBy'offer')]
  47.     private $invoices;
  48.     public function __construct()
  49.     {
  50.         $this->subscriptions = new ArrayCollection();
  51.         $this->invoices = new ArrayCollection();
  52.     }
  53.     public function getPrice() {
  54.         if ($this->billing == 'monthly') {
  55.             return $this->monthlyPrice;
  56.         }
  57.         else if ($this->billing == 'yearly') {
  58.             return $this->annualPrice;
  59.         }
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name $name;
  72.         return $this;
  73.     }
  74.     public function getSportLimit(): ?string
  75.     {
  76.         return $this->sportLimit;
  77.     }
  78.     public function setSportLimit(string $sportLimit): self
  79.     {
  80.         $this->sportLimit $sportLimit;
  81.         return $this;
  82.     }
  83.     public function getCourseLimit(): ?string
  84.     {
  85.         return $this->courseLimit;
  86.     }
  87.     public function setCourseLimit(string $courseLimit): self
  88.     {
  89.         $this->courseLimit $courseLimit;
  90.         return $this;
  91.     }
  92.     public function getTemplateLimit(): ?string
  93.     {
  94.         return $this->templateLimit;
  95.     }
  96.     public function setTemplateLimit(string $templateLimit): self
  97.     {
  98.         $this->templateLimit $templateLimit;
  99.         return $this;
  100.     }
  101.     public function getHasMessaging(): ?bool
  102.     {
  103.         return $this->hasMessaging;
  104.     }
  105.     public function setHasMessaging(bool $hasMessaging): self
  106.     {
  107.         $this->hasMessaging $hasMessaging;
  108.         return $this;
  109.     }
  110.     public function getHasChat(): ?bool
  111.     {
  112.         return $this->hasChat;
  113.     }
  114.     public function setHasChat(bool $hasChat): self
  115.     {
  116.         $this->hasChat $hasChat;
  117.         return $this;
  118.     }
  119.     public function getHasIframeNotation(): ?bool
  120.     {
  121.         return $this->hasIframeNotation;
  122.     }
  123.     public function setHasIframeNotation(bool $hasIframeNotation): self
  124.     {
  125.         $this->hasIframeNotation $hasIframeNotation;
  126.         return $this;
  127.     }
  128.     public function getHasStats(): ?bool
  129.     {
  130.         return $this->hasStats;
  131.     }
  132.     public function setHasStats(bool $hasStats): self
  133.     {
  134.         $this->hasStats $hasStats;
  135.         return $this;
  136.     }
  137.     public function getHasStripePayment(): ?bool
  138.     {
  139.         return $this->hasStripePayment;
  140.     }
  141.     public function setHasStripePayment(bool $hasStripePayment): self
  142.     {
  143.         $this->hasStripePayment $hasStripePayment;
  144.         return $this;
  145.     }
  146.     public function getAnnualPrice(): ?string
  147.     {
  148.         return $this->annualPrice;
  149.     }
  150.     public function setAnnualPrice(string $annualPrice): self
  151.     {
  152.         $this->annualPrice $annualPrice;
  153.         return $this;
  154.     }
  155.     public function getMonthlyPrice(): ?string
  156.     {
  157.         return $this->monthlyPrice;
  158.     }
  159.     public function setMonthlyPrice(string $monthlyPrice): self
  160.     {
  161.         $this->monthlyPrice $monthlyPrice;
  162.         return $this;
  163.     }
  164.     public function getBilling(): ?string
  165.     {
  166.         return $this->billing;
  167.     }
  168.     public function setBilling(string $billing): self
  169.     {
  170.         $this->billing $billing;
  171.         return $this;
  172.     }
  173.     public function getStripePriceId(): ?string
  174.     {
  175.         return $this->stripePriceId;
  176.     }
  177.     public function setStripePriceId(string $stripePriceId): self
  178.     {
  179.         $this->stripePriceId $stripePriceId;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return Collection|Subscription[]
  184.      */
  185.     public function getSubscriptions(): Collection
  186.     {
  187.         return $this->subscriptions;
  188.     }
  189.     public function addSubscription(Subscription $subscription): self
  190.     {
  191.         if (!$this->subscriptions->contains($subscription)) {
  192.             $this->subscriptions[] = $subscription;
  193.             $subscription->setOffer($this);
  194.         }
  195.         return $this;
  196.     }
  197.     public function removeSubscription(Subscription $subscription): self
  198.     {
  199.         if ($this->subscriptions->removeElement($subscription)) {
  200.             // set the owning side to null (unless already changed)
  201.             if ($subscription->getOffer() === $this) {
  202.                 $subscription->setOffer(null);
  203.             }
  204.         }
  205.         return $this;
  206.     }
  207.     public function getLabelForm()
  208.     {
  209.         return $this->getName() . ' (' $this->getBilling().')';
  210.     }
  211.     public function getDescription(): ?string
  212.     {
  213.         return $this->description;
  214.     }
  215.     public function setDescription(?string $description): self
  216.     {
  217.         $this->description $description;
  218.         return $this;
  219.     }
  220.     public function getClubLimit(): ?int
  221.     {
  222.         return $this->clubLimit;
  223.     }
  224.     public function setClubLimit(?int $clubLimit): self
  225.     {
  226.         $this->clubLimit $clubLimit;
  227.         return $this;
  228.     }
  229.     /**
  230.      * @return Collection|Invoice[]
  231.      */
  232.     public function getInvoices(): Collection
  233.     {
  234.         return $this->invoices;
  235.     }
  236.     public function addInvoice(Invoice $invoice): self
  237.     {
  238.         if (!$this->invoices->contains($invoice)) {
  239.             $this->invoices[] = $invoice;
  240.             $invoice->setOffer($this);
  241.         }
  242.         return $this;
  243.     }
  244.     public function removeInvoice(Invoice $invoice): self
  245.     {
  246.         if ($this->invoices->removeElement($invoice)) {
  247.             // set the owning side to null (unless already changed)
  248.             if ($invoice->getOffer() === $this) {
  249.                 $invoice->setOffer(null);
  250.             }
  251.         }
  252.         return $this;
  253.     }
  254. }