<?php
namespace App\Entity\Gos;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Repository\NotifyRepository")
* @ORM\HasLifecycleCallbacks
*/
class Notify
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private $ordTran;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $transactionId;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $payDate;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentStatus", inversedBy="notify")
* @ORM\JoinColumn()
*/
private $paymentStatus;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentSystem", inversedBy="notify")
* @ORM\JoinColumn()
*/
private $paymentSystem;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\OrderPart", mappedBy="masterNotify")
*/
private $masterOrderPart;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\OrderPart", inversedBy="notify")
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $orderPart;
/**
* @ORM\Column(name="body", type="json")
*/
private $body;
/**
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->ordTran;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set ordTran
*
* @param string $ordTran
*
* @return Notify
*/
public function setOrdTran($ordTran)
{
$this->ordTran = $ordTran;
return $this;
}
/**
* Get ordTran
*
* @return string
*/
public function getOrdTran()
{
return $this->ordTran;
}
/**
* Set transactionId
*
* @param string $transactionId
*
* @return Notify
*/
public function setTransactionId($transactionId)
{
$this->transactionId = $transactionId;
return $this;
}
/**
* Get transactionId
*
* @return string
*/
public function getTransactionId()
{
return $this->transactionId;
}
/**
* Set payDate
*
* @param \DateTime $payDate
*
* @return Notify
*/
public function setPayDate($payDate)
{
$this->payDate = $payDate;
return $this;
}
/**
* Get payDate
*
* @return \DateTime
*/
public function getPayDate()
{
return $this->payDate;
}
/**
* Set body
*
* @param array $body
*
* @return Notify
*/
public function setBody($body)
{
$this->body = $body;
return $this;
}
/**
* Get body
*
* @return array
*/
public function getBody()
{
return $this->body;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Notify
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return Notify
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set paymentStatus
*
* @param \App\Entity\Gos\PaymentStatus $paymentStatus
*
* @return Notify
*/
public function setPaymentStatus(\App\Entity\Gos\PaymentStatus $paymentStatus = null)
{
$this->paymentStatus = $paymentStatus;
return $this;
}
/**
* Get paymentStatus
*
* @return \App\Entity\Gos\PaymentStatus
*/
public function getPaymentStatus()
{
return $this->paymentStatus;
}
/**
* Set paymentSystem
*
* @param \App\Entity\Gos\PaymentSystem $paymentSystem
*
* @return Notify
*/
public function setPaymentSystem(\App\Entity\Gos\PaymentSystem $paymentSystem = null)
{
$this->paymentSystem = $paymentSystem;
return $this;
}
/**
* Get paymentSystem
*
* @return \App\Entity\Gos\PaymentSystem
*/
public function getPaymentSystem()
{
return $this->paymentSystem;
}
/**
* Set masterOrderPart
*
* @param \App\Entity\Gos\OrderPart $masterOrderPart
*
* @return Notify
*/
public function setMasterOrderPart(\App\Entity\Gos\OrderPart $masterOrderPart = null)
{
$this->masterOrderPart = $masterOrderPart;
return $this;
}
/**
* Get masterOrderPart
*
* @return \App\Entity\Gos\OrderPart
*/
public function getMasterOrderPart()
{
return $this->masterOrderPart;
}
/**
* Set orderPart
*
* @param \App\Entity\Gos\OrderPart $orderPart
*
* @return Notify
*/
public function setOrderPart(\App\Entity\Gos\OrderPart $orderPart = null)
{
$this->orderPart = $orderPart;
return $this;
}
/**
* Get orderPart
*
* @return \App\Entity\Gos\OrderPart
*/
public function getOrderPart()
{
return $this->orderPart;
}
public function isSuccessfullyPaid(): bool
{
return $this->paymentStatus->getId() === 3;
}
}