src/Entity/System/SubscriptionCustomer.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(name="subscription_customer")
  7.  *
  8.  * @ORM\Entity(repositoryClass="App\Repository\System\SubscriptionCustomerRepository")
  9.  */
  10. class SubscriptionCustomer
  11. {
  12.     /**
  13.      * @var int
  14.      *
  15.      * @ORM\Id
  16.      *
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      *
  19.      * @ORM\Column(type="integer", name="id")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var Customer
  24.      *
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer")
  26.      *
  27.      * @ORM\JoinColumn(referencedColumnName="id_customer", name="id_customer")
  28.      */
  29.     private $customer;
  30.     /**
  31.      * @var SubscriptionStatus
  32.      *
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\System\SubscriptionStatus")
  34.      */
  35.     private $subscriptionStatus;
  36.     /**
  37.      * @var SubscriptionData
  38.      *
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\System\SubscriptionData", inversedBy="subscriptionCustomers")
  40.      */
  41.     private $subscriptionData;
  42.     /**
  43.      * @var string|null
  44.      *
  45.      * @ORM\Column(type="string", length=512, name="request", nullable=true)
  46.      */
  47.     private $request;
  48.     /**
  49.      * @var \DateTime
  50.      *
  51.      * @ORM\Column(name="date_add", type="datetime")
  52.      */
  53.     private $dateAdd;
  54.     /**
  55.      * @var \DateTime
  56.      *
  57.      * @ORM\Column(name="date_upd", type="datetime")
  58.      */
  59.     private $dateUpd;
  60.     /**
  61.      * @var \DateTime
  62.      *
  63.      * @ORM\Column(name="date_start", type="datetime", nullable=true)
  64.      */
  65.     private $dateStart;
  66.     /**
  67.      * @var \DateTime
  68.      *
  69.      * @ORM\Column(name="date_due", type="datetime", nullable=true)
  70.      */
  71.     private $dateDue;
  72.     /**
  73.      * @var int|null
  74.      *
  75.      * @ORM\Column(name="number_attempts", columnDefinition="smallint(3)", type="integer", options={"default" : 0}, nullable=true)
  76.      */
  77.     private $numberAttempts;
  78.     /**
  79.      * @var SubscriptionCustomerType
  80.      *
  81.      * @ORM\ManyToOne(targetEntity="App\Entity\System\SubscriptionCustomerType")
  82.      */
  83.     private $subscriptionCustomerType;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\Entity\System\SubscriptionLine", inversedBy="subscriptionCustomers")
  86.      *
  87.      * @ORM\JoinColumn(referencedColumnName="id_subscription_lines", name="subscription_line_id")
  88.      */
  89.     private ?SubscriptionLine $subscriptionLine null;
  90.     /**
  91.      * @ORM\Column(type="string", length=64, name="internal_migration_status", nullable=true)
  92.      */
  93.     private ?string $internalMigrationStatus;
  94.     /**
  95.      * @ORM\Column(type="text", nullable=true)
  96.      */
  97.     private ?string $nonRenewableInformation null;
  98.     /**
  99.      * @ORM\Column(name="date_non_renewal_request", nullable=true, type="datetime")
  100.      */
  101.     private ?\DateTime $dateNonRenewalRequest null;
  102.     public function __construct()
  103.     {
  104.         $this->dateAdd = new \DateTime();
  105.         $this->dateUpd = new \DateTime();
  106.     }
  107.     /**
  108.      * @return int
  109.      */
  110.     public function getId(): int
  111.     {
  112.         return $this->id;
  113.     }
  114.     /**
  115.      * @return Customer
  116.      */
  117.     public function getCustomer(): Customer
  118.     {
  119.         return $this->customer;
  120.     }
  121.     /**
  122.      * @param Customer $customer
  123.      *
  124.      * @return SubscriptionCustomer
  125.      */
  126.     public function setCustomer(Customer $customer): self
  127.     {
  128.         $this->customer $customer;
  129.         return $this;
  130.     }
  131.     /**
  132.      * @return SubscriptionData
  133.      */
  134.     public function getSubscriptionData(): SubscriptionData
  135.     {
  136.         return $this->subscriptionData;
  137.     }
  138.     /**
  139.      * @param SubscriptionData $subscriptionData
  140.      *
  141.      * @return SubscriptionCustomer
  142.      */
  143.     public function setSubscriptionData(SubscriptionData $subscriptionData): self
  144.     {
  145.         $this->subscriptionData $subscriptionData;
  146.         return $this;
  147.     }
  148.     /**
  149.      * @param SubscriptionStatus $subscriptionStatus
  150.      *
  151.      * @return SubscriptionCustomer
  152.      */
  153.     public function setSubscriptionStatus(SubscriptionStatus $subscriptionStatus): self
  154.     {
  155.         $this->subscriptionStatus $subscriptionStatus;
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return SubscriptionStatus
  160.      */
  161.     public function getSubscriptionStatus(): SubscriptionStatus
  162.     {
  163.         return $this->subscriptionStatus;
  164.     }
  165.     /**
  166.      * @return string|null
  167.      */
  168.     public function getRequest(): ?string
  169.     {
  170.         return $this->request;
  171.     }
  172.     /**
  173.      * @param string|null $request
  174.      *
  175.      * @return SubscriptionCustomer
  176.      */
  177.     public function setRequest(?string $request null): self
  178.     {
  179.         $this->request $request;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @param \DateTime|null $dateDue
  184.      *
  185.      * @return SubscriptionCustomer
  186.      */
  187.     public function setDateDue(?\DateTime $dateDue): self
  188.     {
  189.         $this->dateDue $dateDue;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @param \DateTime $dateStart
  194.      *
  195.      * @return SubscriptionCustomer
  196.      */
  197.     public function setDateStart(\DateTime $dateStart): self
  198.     {
  199.         $this->dateStart $dateStart;
  200.         return $this;
  201.     }
  202.     /**
  203.      * @param \DateTime $dateUpd
  204.      *
  205.      * @return SubscriptionCustomer
  206.      */
  207.     public function setDateUpd(\DateTime $dateUpd): self
  208.     {
  209.         $this->dateUpd $dateUpd;
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return SubscriptionCustomer
  214.      */
  215.     public function setDateAdd(): self
  216.     {
  217.         $this->dateAdd = new \DateTime();
  218.         return $this;
  219.     }
  220.     /**
  221.      * @return SubscriptionCustomerType
  222.      */
  223.     public function getSubscriptionCustomerType(): SubscriptionCustomerType
  224.     {
  225.         return $this->subscriptionCustomerType;
  226.     }
  227.     /**
  228.      * @param SubscriptionCustomerType $subscriptionCustomerType
  229.      *
  230.      * @return SubscriptionCustomer
  231.      */
  232.     public function setSubscriptionCustomerType(SubscriptionCustomerType $subscriptionCustomerType): self
  233.     {
  234.         $this->subscriptionCustomerType $subscriptionCustomerType;
  235.         return $this;
  236.     }
  237.     public function setNumberAttempts(int $numberAttempts): self
  238.     {
  239.         $this->numberAttempts $numberAttempts;
  240.         return $this;
  241.     }
  242.     public function setNumberOfAttempts(bool $increase): self
  243.     {
  244.         if (true === $increase) {
  245.             $this->numberAttempts++;
  246.         } else {
  247.             $this->numberAttempts 0;
  248.         }
  249.         return $this;
  250.     }
  251.     /**
  252.      * @return int|null
  253.      */
  254.     public function getNumberAttempts(): ?int
  255.     {
  256.         return $this->numberAttempts;
  257.     }
  258.     /**
  259.      * @return \DateTime|null
  260.      */
  261.     public function getDateDue(): ?\DateTime
  262.     {
  263.         return $this->dateDue;
  264.     }
  265.     public function getDateAdd(): \DateTime
  266.     {
  267.         return $this->dateAdd;
  268.     }
  269.     public function getDateUpd(): \DateTime
  270.     {
  271.         return $this->dateUpd;
  272.     }
  273.     public function getDateStart(): ?\DateTime
  274.     {
  275.         return $this->dateStart;
  276.     }
  277.     public function getSubscriptionLine(): ?SubscriptionLine
  278.     {
  279.         return $this->subscriptionLine;
  280.     }
  281.     public function setSubscriptionLine(?SubscriptionLine $subscriptionLine): SubscriptionCustomer
  282.     {
  283.         $this->subscriptionLine $subscriptionLine;
  284.         return $this;
  285.     }
  286.     public function getInternalMigrationStatus(): ?string
  287.     {
  288.         return $this->internalMigrationStatus;
  289.     }
  290.     public function setInternalMigrationStatus(?string $internalMigrationStatus): SubscriptionCustomer
  291.     {
  292.         $this->internalMigrationStatus $internalMigrationStatus;
  293.         return $this;
  294.     }
  295.     public function getNonRenewableInformation(): ?string
  296.     {
  297.         return $this->nonRenewableInformation;
  298.     }
  299.     public function setNonRenewableInformation(?string $nonRenewableInformation): SubscriptionCustomer
  300.     {
  301.         $this->nonRenewableInformation $nonRenewableInformation;
  302.         return $this;
  303.     }
  304.     public function getDateNonRenewalRequest(): ?\DateTime
  305.     {
  306.         return $this->dateNonRenewalRequest;
  307.     }
  308.     public function setDateNonRenewalRequest(?\DateTime $dateNonRenewalRequest): SubscriptionCustomer
  309.     {
  310.         $this->dateNonRenewalRequest $dateNonRenewalRequest;
  311.         return $this;
  312.     }
  313. }