src/Entity/StripePrice.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\StripePriceRepository")
  8.  */
  9. class StripePrice
  10. {
  11.     public function __construct()
  12.     {
  13.         $this->stripe_subscriptions = new ArrayCollection();
  14.         $this->products_one_shot = new ArrayCollection();
  15.         $this->products_recurring = new ArrayCollection();
  16.     }
  17.     /**
  18.      * @ORM\Id()
  19.      *
  20.      * @ORM\GeneratedValue()
  21.      *
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $stripe_id;
  29.     /**
  30.      * @ORM\Column(type="integer")
  31.      */
  32.     private $unit_amount;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $reccuring_interval;
  37.     /**
  38.      * @ORM\Column(type="boolean")
  39.      */
  40.     private $active;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true,  options={"default": 1})
  43.      */
  44.     private $display;
  45.     /**
  46.      * @ORM\Column(type="string", length=255)
  47.      */
  48.     private $currency;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $type;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private $tax_rate;
  57.     /**
  58.      * @ORM\Column(type="boolean")
  59.      */
  60.     private $address_required false;
  61.     /**
  62.      * @ORM\Column(type="boolean")
  63.      */
  64.     private $highlighted false;
  65.     /**
  66.      * @ORM\Column(type="datetime", nullable=true)
  67.      */
  68.     private $duaj_publication_date;
  69.     /**
  70.      * @ORM\Column(type="string", nullable=true)
  71.      */
  72.     private $duaj_quadri_code;
  73.     /**
  74.      * @ORM\ManyToOne(targetEntity="App\Entity\StripeProduct", inversedBy="product_prices")
  75.      */
  76.     private $stripe_product;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity="App\Entity\StripeSubscription", mappedBy="stripe_price")
  79.      */
  80.     private $stripe_subscriptions;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity="App\Entity\ProductRecurringOneShot", mappedBy="one_shot_product")
  83.      */
  84.     private $products_recurring;
  85.     /**
  86.      * @ORM\OneToMany(targetEntity="App\Entity\ProductRecurringOneShot", mappedBy="recurring_product")
  87.      */
  88.     private $products_one_shot;
  89.     public function getId(): ?int
  90.     {
  91.         return $this->id;
  92.     }
  93.     public function getStripeId(): ?string
  94.     {
  95.         return $this->stripe_id;
  96.     }
  97.     public function setStripeId(string $stripe_id): self
  98.     {
  99.         $this->stripe_id $stripe_id;
  100.         return $this;
  101.     }
  102.     public function getUnitAmount(): ?int
  103.     {
  104.         return $this->unit_amount;
  105.     }
  106.     public function setUnitAmount(int $unit_amount): self
  107.     {
  108.         $this->unit_amount $unit_amount;
  109.         return $this;
  110.     }
  111.     public function getReccuringInterval(): ?string
  112.     {
  113.         return $this->reccuring_interval;
  114.     }
  115.     public function setReccuringInterval(?string $reccuring_interval): self
  116.     {
  117.         $this->reccuring_interval $reccuring_interval;
  118.         return $this;
  119.     }
  120.     public function getActive(): ?bool
  121.     {
  122.         return $this->active;
  123.     }
  124.     public function setActive(bool $active): self
  125.     {
  126.         $this->active $active;
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return mixed
  131.      */
  132.     public function getDisplay()
  133.     {
  134.         return $this->display;
  135.     }
  136.     /**
  137.      * @param mixed $display
  138.      */
  139.     public function setDisplay($display): self
  140.     {
  141.         $this->display $display;
  142.         return $this;
  143.     }
  144.     public function getCurrency(): ?string
  145.     {
  146.         return $this->currency;
  147.     }
  148.     public function setCurrency(string $currency): self
  149.     {
  150.         $this->currency $currency;
  151.         return $this;
  152.     }
  153.     public function getType(): ?string
  154.     {
  155.         return $this->type;
  156.     }
  157.     public function setType(?string $type): self
  158.     {
  159.         $this->type $type;
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return mixed
  164.      */
  165.     public function getTaxRate()
  166.     {
  167.         return $this->tax_rate;
  168.     }
  169.     /**
  170.      * @param mixed $tax_rate
  171.      *
  172.      * @return StripePrice
  173.      */
  174.     public function setTaxRate($tax_rate)
  175.     {
  176.         $this->tax_rate $tax_rate;
  177.         return $this;
  178.     }
  179.     public function getAddressRequired(): bool
  180.     {
  181.         return $this->address_required;
  182.     }
  183.     public function setAddressRequired(bool $address_required): self
  184.     {
  185.         $this->address_required $address_required;
  186.         return $this;
  187.     }
  188.     public function getHighlighted(): bool
  189.     {
  190.         return $this->highlighted;
  191.     }
  192.     public function setHighlighted(bool $highlighted): self
  193.     {
  194.         $this->highlighted $highlighted;
  195.         return $this;
  196.     }
  197.     /**
  198.      * @return mixed
  199.      */
  200.     public function getDuajPublicationDate()
  201.     {
  202.         return $this->duaj_publication_date;
  203.     }
  204.     /**
  205.      * @param mixed $duaj_publication_date
  206.      */
  207.     public function setDuajPublicationDate($duaj_publication_date): void
  208.     {
  209.         $this->duaj_publication_date $duaj_publication_date;
  210.     }
  211.     /**
  212.      * @return mixed
  213.      */
  214.     public function getDuajQuadriCode()
  215.     {
  216.         return $this->duaj_quadri_code;
  217.     }
  218.     /**
  219.      * @param mixed $duaj_quadri_code
  220.      */
  221.     public function setDuajQuadriCode($duaj_quadri_code): void
  222.     {
  223.         $this->duaj_quadri_code $duaj_quadri_code;
  224.     }
  225.     public function getStripeProduct(): ?StripeProduct
  226.     {
  227.         return $this->stripe_product;
  228.     }
  229.     public function setStripeProduct(?StripeProduct $stripe_product): self
  230.     {
  231.         $this->stripe_product $stripe_product;
  232.         return $this;
  233.     }
  234.     public function getStripeSubscriptions(): Collection
  235.     {
  236.         return $this->stripe_subscriptions;
  237.     }
  238.     public function setStripeSubscription(StripeSubscription $stripe_subscription): self
  239.     {
  240.         $this->stripe_subscription $stripe_subscription;
  241.         return $this;
  242.     }
  243.     public function addStripeSubscription(StripeSubscription $stripeSubscription): self
  244.     {
  245.         if (!$this->stripe_subscriptions->contains($stripeSubscription)) {
  246.             $this->stripe_subscriptions[] = $stripeSubscription;
  247.             $stripeSubscription->setStripePrice($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeStripeSubscription(StripeSubscription $stripeSubscription): self
  252.     {
  253.         if ($this->stripe_subscriptions->contains($stripeSubscription)) {
  254.             $this->stripe_subscriptions->removeElement($stripeSubscription);
  255.             if ($stripeSubscription->getStripePrice() === $this) {
  256.                 $stripeSubscription->setStripePrice(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     public function getProductsRecurring(): ?Collection
  262.     {
  263.         return $this->products_recurring;
  264.     }
  265.     public function addProductRecurring(ProductRecurringOneShot $productRecurring): self
  266.     {
  267.         if (!$this->products_recurring->contains($productRecurring)) {
  268.             $this->products_recurring[] = $productRecurring;
  269.             $productRecurring->setOneShotProduct($this);
  270.         }
  271.         return $this;
  272.     }
  273.     public function removeProductRecurring(ProductRecurringOneShot $productRecurring): self
  274.     {
  275.         if ($this->products_recurring->contains($productRecurring)) {
  276.             $this->products_recurring->removeElement($productRecurring);
  277.             if ($productRecurring->getOneShotProduct() === $this) {
  278.                 $productRecurring->setOneShotProduct(null);
  279.             }
  280.         }
  281.         return $this;
  282.     }
  283.     public function getProductsOneShot(): ?Collection
  284.     {
  285.         return $this->products_one_shot;
  286.     }
  287.     public function addProductOneShot(ProductRecurringOneShot $productOneShot): self
  288.     {
  289.         if (!$this->products_one_shot->contains($productOneShot)) {
  290.             $this->products_one_shot[] = $productOneShot;
  291.             $productOneShot->setRecurringProduct($this);
  292.         }
  293.         return $this;
  294.     }
  295.     public function removeProductOneShot(ProductRecurringOneShot $productOneShot): self
  296.     {
  297.         if ($this->products_one_shot->contains($productOneShot)) {
  298.             $this->products_one_shot->removeElement($productOneShot);
  299.             if ($productOneShot->getRecurringProduct() === $this) {
  300.                 $productOneShot->setRecurringProduct(null);
  301.             }
  302.         }
  303.         return $this;
  304.     }
  305. }