src/Entity/Subscription.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SubscriptionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=SubscriptionRepository::class)
  9.  */
  10. class Subscription
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $server_address;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $server_ip;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="subscriptions")
  28.      */
  29.     private $client;
  30.     /**
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     private $amount_users;
  34.     /**
  35.      * @ORM\Column(type="decimal", precision=10, scale=2)
  36.      */
  37.     private $product_price;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=PaymentTerm::class, inversedBy="subscriptions")
  40.      */
  41.     private $payment_term;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Payment::class, inversedBy="subscriptions")
  44.      */
  45.     private $payment;
  46.     /**
  47.      * @ORM\Column(type="boolean")
  48.      */
  49.     private $is_auto_renew;
  50.     /**
  51.      * @ORM\Column(type="boolean")
  52.      */
  53.     private $is_active;
  54.     /**
  55.      * @ORM\Column(type="datetime", nullable=true)
  56.      */
  57.     private $reg_datetime;
  58.     /**
  59.      * @ORM\Column(type="date", nullable=true)
  60.      */
  61.     private $activation_date;
  62.     /**
  63.      * @ORM\ManyToOne(targetEntity=Addon::class, inversedBy="subscriptions")
  64.      */
  65.     private $addon;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="subscriptions")
  68.      */
  69.     private $product;
  70.     /**
  71.      * @ORM\Column(type="date", nullable=true)
  72.      */
  73.     private $billing_date;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=Invoice::class, mappedBy="subscription")
  76.      */
  77.     private $invoices;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity=ProductWebhosting::class, inversedBy="subscriptions")
  80.      */
  81.     private $product_webhosting;
  82.     /**
  83.      * @ORM\Column(type="string", length=255, nullable=true)
  84.      */
  85.     private $domain;
  86.     public function __construct()
  87.     {
  88.         $this->invoices = new ArrayCollection();
  89.     }
  90.     public function getId(): ?int
  91.     {
  92.         return $this->id;
  93.     }
  94.     public function getServerAddress(): ?string
  95.     {
  96.         return $this->server_address;
  97.     }
  98.     public function setServerAddress(string $server_address): self
  99.     {
  100.         $this->server_address $server_address;
  101.         return $this;
  102.     }
  103.     public function getServerIp(): ?string
  104.     {
  105.         return $this->server_ip;
  106.     }
  107.     public function setServerIp(?string $server_ip): self
  108.     {
  109.         $this->server_ip $server_ip;
  110.         return $this;
  111.     }
  112.     public function getClient(): ?User
  113.     {
  114.         return $this->client;
  115.     }
  116.     public function setClient(?User $client): self
  117.     {
  118.         $this->client $client;
  119.         return $this;
  120.     }
  121.     public function getAmountUsers(): ?int
  122.     {
  123.         return $this->amount_users;
  124.     }
  125.     public function setAmountUsers(int $amount_users): self
  126.     {
  127.         $this->amount_users $amount_users;
  128.         return $this;
  129.     }
  130.     public function getProductPrice(): ?string
  131.     {
  132.         return $this->product_price;
  133.     }
  134.     public function setProductPrice(string $product_price): self
  135.     {
  136.         $this->product_price $product_price;
  137.         return $this;
  138.     }
  139.     public function getPaymentTerm(): ?PaymentTerm
  140.     {
  141.         return $this->payment_term;
  142.     }
  143.     public function setPaymentTerm(?PaymentTerm $payment_term): self
  144.     {
  145.         $this->payment_term $payment_term;
  146.         return $this;
  147.     }
  148.     public function getPayment(): ?Payment
  149.     {
  150.         return $this->payment;
  151.     }
  152.     public function setPayment(?Payment $payment): self
  153.     {
  154.         $this->payment $payment;
  155.         return $this;
  156.     }
  157.     public function isIsAutoRenew(): ?bool
  158.     {
  159.         return $this->is_auto_renew;
  160.     }
  161.     public function setIsAutoRenew(bool $is_auto_renew): self
  162.     {
  163.         $this->is_auto_renew $is_auto_renew;
  164.         return $this;
  165.     }
  166.     public function isIsActive(): ?bool
  167.     {
  168.         return $this->is_active;
  169.     }
  170.     public function setIsActive(bool $is_active): self
  171.     {
  172.         $this->is_active $is_active;
  173.         return $this;
  174.     }
  175.     public function getRegDatetime(): ?\DateTimeInterface
  176.     {
  177.         return $this->reg_datetime;
  178.     }
  179.     public function setRegDatetime(?\DateTimeInterface $reg_datetime): self
  180.     {
  181.         $this->reg_datetime $reg_datetime;
  182.         return $this;
  183.     }
  184.     public function getActivationDate(): ?\DateTimeInterface
  185.     {
  186.         return $this->activation_date;
  187.     }
  188.     public function setActivationDate(?\DateTimeInterface $activation_date): self
  189.     {
  190.         $this->activation_date $activation_date;
  191.         return $this;
  192.     }
  193.     public function getAddon(): ?Addon
  194.     {
  195.         return $this->addon;
  196.     }
  197.     public function setAddon(?Addon $addon): self
  198.     {
  199.         $this->addon $addon;
  200.         return $this;
  201.     }
  202.     public function getProduct(): ?Product
  203.     {
  204.         return $this->product;
  205.     }
  206.     public function setProduct(?Product $product): self
  207.     {
  208.         $this->product $product;
  209.         return $this;
  210.     }
  211.     public function getBillingDate(): ?\DateTimeInterface
  212.     {
  213.         return $this->billing_date;
  214.     }
  215.     public function setBillingDate(?\DateTimeInterface $billing_date): self
  216.     {
  217.         $this->billing_date $billing_date;
  218.         return $this;
  219.     }
  220.     /**
  221.      * @return Collection<int, Invoice>
  222.      */
  223.     public function getInvoices(): Collection
  224.     {
  225.         return $this->invoices;
  226.     }
  227.     public function addInvoice(Invoice $invoice): self
  228.     {
  229.         if (!$this->invoices->contains($invoice)) {
  230.             $this->invoices[] = $invoice;
  231.             $invoice->setSubscription($this);
  232.         }
  233.         return $this;
  234.     }
  235.     public function removeInvoice(Invoice $invoice): self
  236.     {
  237.         if ($this->invoices->removeElement($invoice)) {
  238.             // set the owning side to null (unless already changed)
  239.             if ($invoice->getSubscription() === $this) {
  240.                 $invoice->setSubscription(null);
  241.             }
  242.         }
  243.         return $this;
  244.     }
  245.     public function getProductWebhosting(): ?ProductWebhosting
  246.     {
  247.         return $this->product_webhosting;
  248.     }
  249.     public function setProductWebhosting(?ProductWebhosting $product_webhosting): self
  250.     {
  251.         $this->product_webhosting $product_webhosting;
  252.         return $this;
  253.     }
  254.     public function getDomain(): ?string
  255.     {
  256.         return $this->domain;
  257.     }
  258.     public function setDomain(?string $domain): self
  259.     {
  260.         $this->domain $domain;
  261.         return $this;
  262.     }
  263. }