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