src/Entity/Gos/OrdersDataTemp.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * OrdersDataTemp
  6.  *
  7.  * @ORM\Table(name="orders_data_temp")
  8.  * @ORM\Entity(repositoryClass="App\Repository\OrdersDataTempRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class OrdersDataTemp
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var bool
  23.      *
  24.      * @ORM\Column(type="boolean", nullable=true)
  25.      */
  26.     private $isActive;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="name", type="string", length=255, nullable=true)
  31.      */
  32.     private $name;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(name="surname", type="string", length=255, nullable=true)
  37.      */
  38.     private $surname;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="ord_tran", type="string", length=255, nullable=true)
  43.      */
  44.     private $ordTran;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(name="product_variant_no", type="string", length=255, nullable=true)
  49.      */
  50.     private $productVariantNo;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(name="payment_type", type="string", length=255, nullable=true)
  55.      */
  56.     private $paymentType;
  57.     /**
  58.      * @var string
  59.      *
  60.      * @ORM\Column(name="price_net", type="string", length=255, nullable=true)
  61.      */
  62.     private $priceNet;
  63.     /**
  64.      * @var string
  65.      *
  66.      * @ORM\Column(name="price_gross", type="string", length=255, nullable=true)
  67.      */
  68.     private $priceGross;
  69.     /**
  70.      * @ORM\Column(name="data_from", type="string", length=255, nullable=true)
  71.      */
  72.     private $dataFrom;
  73.     /**
  74.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="ordersDataTemp")
  75.      * @ORM\JoinColumn()
  76.      */
  77.     private $portalSettings;
  78.     /**
  79.      * @ORM\Column(type="datetime")
  80.      */
  81.     private $createdAt;
  82.     /**
  83.      * @ORM\Column(type="datetime", nullable=true)
  84.      */
  85.     private $updatedAt;
  86.     /** @ORM\PrePersist() */
  87.     public function prePersist()
  88.     {
  89.         $this->createdAt = new \DateTime();
  90.     }
  91.     /** @ORM\PreUpdate() */
  92.     public function preUpdate()
  93.     {
  94.         $this->updatedAt = new \DateTime();
  95.     }
  96.     public function __toString()
  97.     {
  98.         return (string)$this->id;
  99.     }
  100.     public static function import(
  101.         string $ordTran,
  102.         PortalSettings $portalSettings,
  103.         string $imie,
  104.         string $nazwisko,
  105.         string $productVariantNo,
  106.         string $priceNet,
  107.         string $priceGross,
  108.         string $dataFrom
  109.     ): self
  110.     {
  111.         return (new self())
  112.             ->setOrdTran($ordTran)
  113.             ->setPortalSettings($portalSettings)
  114.             ->setIsActive(true)
  115.             ->setName($imie)
  116.             ->setSurname($nazwisko)
  117.             ->setProductVariantNo($productVariantNo)
  118.             ->setPaymentType('3')
  119.             ->setPriceNet($priceNet)
  120.             ->setPriceGross($priceGross)
  121.             ->setCreatedAt(new \DateTime())
  122.             ->setDataFrom($dataFrom);
  123.     }
  124.     /**
  125.      * Get id
  126.      *
  127.      * @return integer
  128.      */
  129.     public function getId()
  130.     {
  131.         return $this->id;
  132.     }
  133.     /**
  134.      * Set name
  135.      *
  136.      * @param string $name
  137.      *
  138.      * @return OrdersDataTemp
  139.      */
  140.     public function setName($name)
  141.     {
  142.         $this->name $name;
  143.         return $this;
  144.     }
  145.     /**
  146.      * Get name
  147.      *
  148.      * @return string
  149.      */
  150.     public function getName()
  151.     {
  152.         return $this->name;
  153.     }
  154.     /**
  155.      * Set surname
  156.      *
  157.      * @param string $surname
  158.      *
  159.      * @return OrdersDataTemp
  160.      */
  161.     public function setSurname($surname)
  162.     {
  163.         $this->surname $surname;
  164.         return $this;
  165.     }
  166.     /**
  167.      * Get surname
  168.      *
  169.      * @return string
  170.      */
  171.     public function getSurname()
  172.     {
  173.         return $this->surname;
  174.     }
  175.     /**
  176.      * Set ordTran
  177.      *
  178.      * @param string $ordTran
  179.      *
  180.      * @return OrdersDataTemp
  181.      */
  182.     public function setOrdTran($ordTran)
  183.     {
  184.         $this->ordTran $ordTran;
  185.         return $this;
  186.     }
  187.     /**
  188.      * Get ordTran
  189.      *
  190.      * @return string
  191.      */
  192.     public function getOrdTran()
  193.     {
  194.         return $this->ordTran;
  195.     }
  196.     /**
  197.      * Set productVariantNo
  198.      *
  199.      * @param string $productVariantNo
  200.      *
  201.      * @return OrdersDataTemp
  202.      */
  203.     public function setProductVariantNo($productVariantNo)
  204.     {
  205.         $this->productVariantNo $productVariantNo;
  206.         return $this;
  207.     }
  208.     /**
  209.      * Get productVariantNo
  210.      *
  211.      * @return string
  212.      */
  213.     public function getProductVariantNo()
  214.     {
  215.         return $this->productVariantNo;
  216.     }
  217.     /**
  218.      * Set paymentType
  219.      *
  220.      * @param string $paymentType
  221.      *
  222.      * @return OrdersDataTemp
  223.      */
  224.     public function setPaymentType($paymentType)
  225.     {
  226.         $this->paymentType $paymentType;
  227.         return $this;
  228.     }
  229.     /**
  230.      * Get paymentType
  231.      *
  232.      * @return string
  233.      */
  234.     public function getPaymentType()
  235.     {
  236.         return $this->paymentType;
  237.     }
  238.     /**
  239.      * Set priceNet
  240.      *
  241.      * @param string $priceNet
  242.      *
  243.      * @return OrdersDataTemp
  244.      */
  245.     public function setPriceNet($priceNet)
  246.     {
  247.         $this->priceNet $priceNet;
  248.         return $this;
  249.     }
  250.     /**
  251.      * Get priceNet
  252.      *
  253.      * @return string
  254.      */
  255.     public function getPriceNet()
  256.     {
  257.         return $this->priceNet;
  258.     }
  259.     /**
  260.      * Set priceGross
  261.      *
  262.      * @param string $priceGross
  263.      *
  264.      * @return OrdersDataTemp
  265.      */
  266.     public function setPriceGross($priceGross)
  267.     {
  268.         $this->priceGross $priceGross;
  269.         return $this;
  270.     }
  271.     /**
  272.      * Get priceGross
  273.      *
  274.      * @return string
  275.      */
  276.     public function getPriceGross()
  277.     {
  278.         return $this->priceGross;
  279.     }
  280.     /**
  281.      * Set createdAt
  282.      *
  283.      * @param \DateTime $createdAt
  284.      *
  285.      * @return OrdersDataTemp
  286.      */
  287.     public function setCreatedAt($createdAt)
  288.     {
  289.         $this->createdAt $createdAt;
  290.         return $this;
  291.     }
  292.     /**
  293.      * Get createdAt
  294.      *
  295.      * @return \DateTime
  296.      */
  297.     public function getCreatedAt()
  298.     {
  299.         return $this->createdAt;
  300.     }
  301.     /**
  302.      * Set updatedAt
  303.      *
  304.      * @param \DateTime $updatedAt
  305.      *
  306.      * @return OrdersDataTemp
  307.      */
  308.     public function setUpdatedAt($updatedAt)
  309.     {
  310.         $this->updatedAt $updatedAt;
  311.         return $this;
  312.     }
  313.     /**
  314.      * Get updatedAt
  315.      *
  316.      * @return \DateTime
  317.      */
  318.     public function getUpdatedAt()
  319.     {
  320.         return $this->updatedAt;
  321.     }
  322.     /**
  323.      * Set portalSettings
  324.      *
  325.      * @param \App\Entity\Gos\PortalSettings $portalSettings
  326.      *
  327.      * @return OrdersDataTemp
  328.      */
  329.     public function setPortalSettings(\App\Entity\Gos\PortalSettings $portalSettings null)
  330.     {
  331.         $this->portalSettings $portalSettings;
  332.         return $this;
  333.     }
  334.     /**
  335.      * Get portalSettings
  336.      *
  337.      * @return \App\Entity\Gos\PortalSettings
  338.      */
  339.     public function getPortalSettings()
  340.     {
  341.         return $this->portalSettings;
  342.     }
  343.     /**
  344.      * Set isActive
  345.      *
  346.      * @param boolean $isActive
  347.      *
  348.      * @return OrdersDataTemp
  349.      */
  350.     public function setIsActive($isActive)
  351.     {
  352.         $this->isActive $isActive;
  353.         return $this;
  354.     }
  355.     /**
  356.      * Get isActive
  357.      *
  358.      * @return boolean
  359.      */
  360.     public function getIsActive()
  361.     {
  362.         return $this->isActive;
  363.     }
  364.     public function getDataFrom(): ?string
  365.     {
  366.         return $this->dataFrom;
  367.     }
  368.     public function setDataFrom(?string $dataFrom): self
  369.     {
  370.         $this->dataFrom $dataFrom;
  371.         return $this;
  372.     }
  373. }