src/Entity/System/SubscriptionLineHistory.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * SubscriptionLine
  7.  *
  8.  * @ORM\Table(name="subscriptions_lines_history", indexes={
  9.  *
  10.  *     @ORM\Index(name="id_subscription_paypal", columns={"id_subscription_paypal"}),
  11.  *     @ORM\Index(name="name", columns={"name"})
  12.  * })
  13.  *
  14.  * @ORM\Entity(repositoryClass="App\Repository\System\SubscriptionLineHistoryRepository")
  15.  */
  16. class SubscriptionLineHistory
  17. {
  18.     public const STATUS_CANCEL 'Cancel';
  19.     public const STATUS_ERROR 'Error';
  20.     public const STATUS_INIT_AMOUNT 'initAmount';
  21.     public const STATUS_FREE_PACK 'freePack';
  22.     public const STATUS_NOT_RENEWED_SUBSCRIPTIONS = [
  23.         self::STATUS_CANCELself::STATUS_ERRORself::STATUS_INIT_AMOUNTself::STATUS_INIT_AMOUNT,
  24.     ];
  25.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\Id
  29.      *
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      *
  32.      * @ORM\Column(type="integer", name="id_subscription_lines_history")
  33.      */
  34.     private $id;
  35.     /**
  36.      * @var Subscription
  37.      *
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Subscription", inversedBy="subscriptionLineHistories")
  39.      *
  40.      * @ORM\JoinColumn(referencedColumnName="id_subscription", name="id_subscription")
  41.      */
  42.     private $subscription;
  43.     /**
  44.      * @var SubscriptionLine
  45.      *
  46.      * @ORM\ManyToOne(targetEntity="SubscriptionLine")
  47.      *
  48.      * @ORM\JoinColumn(name="id_subscription_lines", referencedColumnName="id_subscription_lines")
  49.      */
  50.     private $subscriptionLine;
  51.     /**
  52.      * @var string|null
  53.      *
  54.      * @ORM\Column(type="string", length=100, nullable=true)
  55.      */
  56.     private $name;
  57.     /**
  58.      * @var \DateTime
  59.      *
  60.      * @ORM\Column(type="datetime", options={"default" : "CURRENT_TIMESTAMP"})
  61.      */
  62.     private $dateCreate;
  63.     /**
  64.      * @var Customer
  65.      *
  66.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Customer")
  67.      *
  68.      * @ORM\JoinColumn(referencedColumnName="id_customer", name="id_customer")
  69.      */
  70.     private $customer;
  71.     /**
  72.      * @var bool|null
  73.      *
  74.      * @ORM\Column(type="boolean", nullable=true, options={"default" : "0"})
  75.      */
  76.     private $vies;
  77.     /**
  78.      * @ORM\Column(type="datetime", nullable=true, options={"default" : "0000-00-00 00:00:00"})
  79.      */
  80.     private $dateDue;
  81.     /**
  82.      * @var float|null
  83.      *
  84.      * @ORM\Column(type="float", nullable=true, options={"default" : "0"})
  85.      */
  86.     private $cost;
  87.     /**
  88.      * @var int|null
  89.      *
  90.      * @ORM\Column(type="integer", nullable=true)
  91.      */
  92.     private $userCreate;
  93.     /**
  94.      * @var int|null
  95.      *
  96.      * @ORM\Column(type="integer", nullable=true)
  97.      */
  98.     private $userMod;
  99.     /**
  100.      * @var int|null
  101.      *
  102.      * @ORM\Column(type="integer", nullable=true)
  103.      */
  104.     private ?int $nintentos 0;
  105.     /**
  106.      * @var string|null
  107.      *
  108.      * @ORM\Column(name="id_transaction", type="string", length=100, nullable=true)
  109.      */
  110.     private $transaction;
  111.     /**
  112.      * @var bool|null
  113.      *
  114.      * @ORM\Column(type="boolean", options={"default":0}, nullable=true)
  115.      */
  116.     private $erp;
  117.     /**
  118.      * @var string|null
  119.      *
  120.      * @ORM\Column(type="string", length=100, nullable=true)
  121.      */
  122.     private $idSubscriptionPaypal;
  123.     /**
  124.      * @var string|null
  125.      *
  126.      * @ORM\Column(type="text", nullable=true)
  127.      */
  128.     private $information;
  129.     /**
  130.      * @var array|ArrayCollection<int, SubscriptionCustomerHistory>
  131.      *
  132.      * @ORM\OneToMany(targetEntity="App\Entity\System\SubscriptionCustomerHistory", mappedBy="subscriptionLineHistory", cascade={"persist"})
  133.      */
  134.     private $subscriptionCustomerHistories;
  135.     /**
  136.      * @ORM\Column(type="boolean", nullable=true, options={"default": 0})
  137.      */
  138.     private bool $migrated false;
  139.     /**
  140.      * @ORM\Column(type="string", length=64, name="internal_migration_status", nullable=true)
  141.      */
  142.     private ?string $internalMigrationStatus;
  143.     public function __construct()
  144.     {
  145.         $this->subscriptionCustomerHistories = new ArrayCollection();
  146.     }
  147.     /**
  148.      * @return int
  149.      */
  150.     public function getId(): int
  151.     {
  152.         return $this->id;
  153.     }
  154.     /**
  155.      * @return Subscription
  156.      */
  157.     public function getSubscription(): Subscription
  158.     {
  159.         return $this->subscription;
  160.     }
  161.     /**
  162.      * @param Subscription $subscription
  163.      *
  164.      * @return SubscriptionLineHistory
  165.      */
  166.     public function setSubscription(Subscription $subscription): SubscriptionLineHistory
  167.     {
  168.         $this->subscription $subscription;
  169.         return $this;
  170.     }
  171.     /**
  172.      * @return SubscriptionLine
  173.      */
  174.     public function getSubscriptionLine(): SubscriptionLine
  175.     {
  176.         return $this->subscriptionLine;
  177.     }
  178.     /**
  179.      * @param SubscriptionLine $subscriptionLine
  180.      *
  181.      * @return SubscriptionLineHistory
  182.      */
  183.     public function setSubscriptionLine(SubscriptionLine $subscriptionLine): SubscriptionLineHistory
  184.     {
  185.         $this->subscriptionLine $subscriptionLine;
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return string|null
  190.      */
  191.     public function getName(): ?string
  192.     {
  193.         return $this->name;
  194.     }
  195.     /**
  196.      * @param string|null $name
  197.      *
  198.      * @return SubscriptionLineHistory
  199.      */
  200.     public function setName(?string $name): SubscriptionLineHistory
  201.     {
  202.         $this->name $name;
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return \DateTime
  207.      */
  208.     public function getDateCreate(): \DateTime
  209.     {
  210.         return $this->dateCreate;
  211.     }
  212.     /**
  213.      * @param \DateTime $dateCreate
  214.      *
  215.      * @return SubscriptionLineHistory
  216.      */
  217.     public function setDateCreate(\DateTime $dateCreate): SubscriptionLineHistory
  218.     {
  219.         $this->dateCreate $dateCreate;
  220.         return $this;
  221.     }
  222.     /**
  223.      * @return Customer|null
  224.      */
  225.     public function getCustomer(): ?Customer
  226.     {
  227.         return $this->customer;
  228.     }
  229.     /**
  230.      * @param Customer|null $customer
  231.      *
  232.      * @return SubscriptionLineHistory
  233.      */
  234.     public function setCustomer(?Customer $customer): SubscriptionLineHistory
  235.     {
  236.         $this->customer $customer;
  237.         return $this;
  238.     }
  239.     /**
  240.      * @return bool|null
  241.      */
  242.     public function getVies(): ?bool
  243.     {
  244.         return $this->vies;
  245.     }
  246.     /**
  247.      * @param bool|null $vies
  248.      *
  249.      * @return SubscriptionLineHistory
  250.      */
  251.     public function setVies(?bool $vies): SubscriptionLineHistory
  252.     {
  253.         $this->vies $vies;
  254.         return $this;
  255.     }
  256.     /**
  257.      * @return \DateTime
  258.      */
  259.     public function getDateDue(): ?\DateTime
  260.     {
  261.         return $this->dateDue;
  262.     }
  263.     /**
  264.      * @param \DateTime|null $dateDue
  265.      *
  266.      * @return SubscriptionLineHistory
  267.      */
  268.     public function setDateDue(?\DateTime $dateDue): SubscriptionLineHistory
  269.     {
  270.         $this->dateDue $dateDue;
  271.         return $this;
  272.     }
  273.     /**
  274.      * @return float|null
  275.      */
  276.     public function getCost(): ?float
  277.     {
  278.         return $this->cost;
  279.     }
  280.     /**
  281.      * @param float|null $cost
  282.      *
  283.      * @return SubscriptionLineHistory
  284.      */
  285.     public function setCost(?float $cost): SubscriptionLineHistory
  286.     {
  287.         $this->cost $cost;
  288.         return $this;
  289.     }
  290.     /**
  291.      * @return int|null
  292.      */
  293.     public function getUserCreate(): ?int
  294.     {
  295.         return $this->userCreate;
  296.     }
  297.     /**
  298.      * @param int|null $userCreate
  299.      *
  300.      * @return SubscriptionLineHistory
  301.      */
  302.     public function setUserCreate(?int $userCreate): SubscriptionLineHistory
  303.     {
  304.         $this->userCreate $userCreate;
  305.         return $this;
  306.     }
  307.     /**
  308.      * @return int|null
  309.      */
  310.     public function getUserMod(): ?int
  311.     {
  312.         return $this->userMod;
  313.     }
  314.     /**
  315.      * @param int|null $userMod
  316.      *
  317.      * @return SubscriptionLineHistory
  318.      */
  319.     public function setUserMod(?int $userMod): SubscriptionLineHistory
  320.     {
  321.         $this->userMod $userMod;
  322.         return $this;
  323.     }
  324.     public function getNintentos(): ?int
  325.     {
  326.         return $this->nintentos;
  327.     }
  328.     /**
  329.      * @param int|null $nintentos
  330.      *
  331.      * @return SubscriptionLineHistory
  332.      */
  333.     public function setNintentos(?int $nintentos): SubscriptionLineHistory
  334.     {
  335.         $this->nintentos $nintentos;
  336.         return $this;
  337.     }
  338.     /**
  339.      * @return string|null
  340.      */
  341.     public function getTransaction(): ?string
  342.     {
  343.         return $this->transaction;
  344.     }
  345.     /**
  346.      * @param string|null $transaction
  347.      *
  348.      * @return SubscriptionLineHistory
  349.      */
  350.     public function setTransaction(?string $transaction): SubscriptionLineHistory
  351.     {
  352.         $this->transaction $transaction;
  353.         return $this;
  354.     }
  355.     /**
  356.      * @return bool|null
  357.      */
  358.     public function getErp(): ?bool
  359.     {
  360.         return $this->erp;
  361.     }
  362.     /**
  363.      * @param bool|null $erp
  364.      *
  365.      * @return SubscriptionLineHistory
  366.      */
  367.     public function setErp(?bool $erp): SubscriptionLineHistory
  368.     {
  369.         $this->erp $erp;
  370.         return $this;
  371.     }
  372.     /**
  373.      * @return string|null
  374.      */
  375.     public function getIdSubscriptionPaypal(): ?string
  376.     {
  377.         return $this->idSubscriptionPaypal;
  378.     }
  379.     /**
  380.      * @param string|null $idSubscriptionPaypal
  381.      *
  382.      * @return SubscriptionLineHistory
  383.      */
  384.     public function setIdSubscriptionPaypal(?string $idSubscriptionPaypal): SubscriptionLineHistory
  385.     {
  386.         $this->idSubscriptionPaypal $idSubscriptionPaypal;
  387.         return $this;
  388.     }
  389.     /**
  390.      * @return string|null
  391.      */
  392.     public function getInformation(): ?string
  393.     {
  394.         return $this->information;
  395.     }
  396.     /**
  397.      * @param string|null $information
  398.      *
  399.      * @return SubscriptionLineHistory
  400.      */
  401.     public function setInformation(?string $information): SubscriptionLineHistory
  402.     {
  403.         $this->information $information;
  404.         return $this;
  405.     }
  406.     public function getSubscriptionCustomerHistories(): array
  407.     {
  408.         return $this->subscriptionCustomerHistories;
  409.     }
  410.     public function isMigrated(): bool
  411.     {
  412.         return $this->migrated;
  413.     }
  414.     public function setMigrated(bool $migrated): SubscriptionLineHistory
  415.     {
  416.         $this->migrated $migrated;
  417.         return $this;
  418.     }
  419.     public function getInternalMigrationStatus(): ?string
  420.     {
  421.         return $this->internalMigrationStatus;
  422.     }
  423.     public function setInternalMigrationStatus(?string $internalMigrationStatus): SubscriptionLineHistory
  424.     {
  425.         $this->internalMigrationStatus $internalMigrationStatus;
  426.         return $this;
  427.     }
  428.     public function setLineToMigrated(): SubscriptionLineHistory
  429.     {
  430.         $this->migrated  true;
  431.         $this->internalMigrationStatus 'migrated';
  432.         return $this;
  433.     }
  434. }