src/Entity/Gos/Notify.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6.  * @ORM\Table()
  7.  * @ORM\Entity(repositoryClass="App\Repository\NotifyRepository")
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class Notify
  11. {
  12.     /**
  13.      * @ORM\Column(type="integer")
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue(strategy="IDENTITY")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=150, nullable=true)
  20.      */
  21.     private $ordTran;
  22.     /**
  23.      * @ORM\Column(type="string", nullable=true)
  24.      */
  25.     private $transactionId;
  26.     /**
  27.      * @ORM\Column(type="datetime", nullable=true)
  28.      */
  29.     private $payDate;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentStatus", inversedBy="notify")
  32.      * @ORM\JoinColumn()
  33.      */
  34.     private $paymentStatus;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentSystem", inversedBy="notify")
  37.      * @ORM\JoinColumn()
  38.      */
  39.     private $paymentSystem;
  40.     /**
  41.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\OrderPart", mappedBy="masterNotify")
  42.      */
  43.     private $masterOrderPart;
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderPart", inversedBy="notify")
  46.      * @ORM\JoinColumn(onDelete="CASCADE")
  47.      */
  48.     private $orderPart;
  49.     /**
  50.      * @ORM\Column(name="body", type="json")
  51.      */
  52.     private $body;
  53.     /**
  54.      * @ORM\Column(name="created_at", type="datetime")
  55.      */
  56.     private $createdAt;
  57.     /**
  58.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  59.      */
  60.     private $updatedAt;
  61.     /** @ORM\PrePersist() */
  62.     public function prePersist()
  63.     {
  64.         $this->createdAt = new \DateTime();
  65.     }
  66.     /** @ORM\PreUpdate() */
  67.     public function preUpdate()
  68.     {
  69.         $this->updatedAt = new \DateTime();
  70.     }
  71.     public function __toString()
  72.     {
  73.         return (string)$this->ordTran;
  74.     }
  75.     /**
  76.      * Get id
  77.      *
  78.      * @return integer
  79.      */
  80.     public function getId()
  81.     {
  82.         return $this->id;
  83.     }
  84.     /**
  85.      * Set ordTran
  86.      *
  87.      * @param string $ordTran
  88.      *
  89.      * @return Notify
  90.      */
  91.     public function setOrdTran($ordTran)
  92.     {
  93.         $this->ordTran $ordTran;
  94.         return $this;
  95.     }
  96.     /**
  97.      * Get ordTran
  98.      *
  99.      * @return string
  100.      */
  101.     public function getOrdTran()
  102.     {
  103.         return $this->ordTran;
  104.     }
  105.     /**
  106.      * Set transactionId
  107.      *
  108.      * @param string $transactionId
  109.      *
  110.      * @return Notify
  111.      */
  112.     public function setTransactionId($transactionId)
  113.     {
  114.         $this->transactionId $transactionId;
  115.         return $this;
  116.     }
  117.     /**
  118.      * Get transactionId
  119.      *
  120.      * @return string
  121.      */
  122.     public function getTransactionId()
  123.     {
  124.         return $this->transactionId;
  125.     }
  126.     /**
  127.      * Set payDate
  128.      *
  129.      * @param \DateTime $payDate
  130.      *
  131.      * @return Notify
  132.      */
  133.     public function setPayDate($payDate)
  134.     {
  135.         $this->payDate $payDate;
  136.         return $this;
  137.     }
  138.     /**
  139.      * Get payDate
  140.      *
  141.      * @return \DateTime
  142.      */
  143.     public function getPayDate()
  144.     {
  145.         return $this->payDate;
  146.     }
  147.     /**
  148.      * Set body
  149.      *
  150.      * @param array $body
  151.      *
  152.      * @return Notify
  153.      */
  154.     public function setBody($body)
  155.     {
  156.         $this->body $body;
  157.         return $this;
  158.     }
  159.     /**
  160.      * Get body
  161.      *
  162.      * @return array
  163.      */
  164.     public function getBody()
  165.     {
  166.         return $this->body;
  167.     }
  168.     /**
  169.      * Set createdAt
  170.      *
  171.      * @param \DateTime $createdAt
  172.      *
  173.      * @return Notify
  174.      */
  175.     public function setCreatedAt($createdAt)
  176.     {
  177.         $this->createdAt $createdAt;
  178.         return $this;
  179.     }
  180.     /**
  181.      * Get createdAt
  182.      *
  183.      * @return \DateTime
  184.      */
  185.     public function getCreatedAt()
  186.     {
  187.         return $this->createdAt;
  188.     }
  189.     /**
  190.      * Set updatedAt
  191.      *
  192.      * @param \DateTime $updatedAt
  193.      *
  194.      * @return Notify
  195.      */
  196.     public function setUpdatedAt($updatedAt)
  197.     {
  198.         $this->updatedAt $updatedAt;
  199.         return $this;
  200.     }
  201.     /**
  202.      * Get updatedAt
  203.      *
  204.      * @return \DateTime
  205.      */
  206.     public function getUpdatedAt()
  207.     {
  208.         return $this->updatedAt;
  209.     }
  210.     /**
  211.      * Set paymentStatus
  212.      *
  213.      * @param \App\Entity\Gos\PaymentStatus $paymentStatus
  214.      *
  215.      * @return Notify
  216.      */
  217.     public function setPaymentStatus(\App\Entity\Gos\PaymentStatus $paymentStatus null)
  218.     {
  219.         $this->paymentStatus $paymentStatus;
  220.         return $this;
  221.     }
  222.     /**
  223.      * Get paymentStatus
  224.      *
  225.      * @return \App\Entity\Gos\PaymentStatus
  226.      */
  227.     public function getPaymentStatus()
  228.     {
  229.         return $this->paymentStatus;
  230.     }
  231.     /**
  232.      * Set paymentSystem
  233.      *
  234.      * @param \App\Entity\Gos\PaymentSystem $paymentSystem
  235.      *
  236.      * @return Notify
  237.      */
  238.     public function setPaymentSystem(\App\Entity\Gos\PaymentSystem $paymentSystem null)
  239.     {
  240.         $this->paymentSystem $paymentSystem;
  241.         return $this;
  242.     }
  243.     /**
  244.      * Get paymentSystem
  245.      *
  246.      * @return \App\Entity\Gos\PaymentSystem
  247.      */
  248.     public function getPaymentSystem()
  249.     {
  250.         return $this->paymentSystem;
  251.     }
  252.     /**
  253.      * Set masterOrderPart
  254.      *
  255.      * @param \App\Entity\Gos\OrderPart $masterOrderPart
  256.      *
  257.      * @return Notify
  258.      */
  259.     public function setMasterOrderPart(\App\Entity\Gos\OrderPart $masterOrderPart null)
  260.     {
  261.         $this->masterOrderPart $masterOrderPart;
  262.         return $this;
  263.     }
  264.     /**
  265.      * Get masterOrderPart
  266.      *
  267.      * @return \App\Entity\Gos\OrderPart
  268.      */
  269.     public function getMasterOrderPart()
  270.     {
  271.         return $this->masterOrderPart;
  272.     }
  273.     /**
  274.      * Set orderPart
  275.      *
  276.      * @param \App\Entity\Gos\OrderPart $orderPart
  277.      *
  278.      * @return Notify
  279.      */
  280.     public function setOrderPart(\App\Entity\Gos\OrderPart $orderPart null)
  281.     {
  282.         $this->orderPart $orderPart;
  283.         return $this;
  284.     }
  285.     /**
  286.      * Get orderPart
  287.      *
  288.      * @return \App\Entity\Gos\OrderPart
  289.      */
  290.     public function getOrderPart()
  291.     {
  292.         return $this->orderPart;
  293.     }
  294.     public function isSuccessfullyPaid(): bool
  295.     {
  296.         return $this->paymentStatus->getId() === 3;
  297.     }
  298. }