src/AppBundle/MainBundle/Entity/Orders_Refund.php line 247

Open in your IDE?
  1. <?php
  2. namespace App\AppBundle\MainBundle\Entity;
  3. use DateTime;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use PetstoreIO\Order;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use JsonSerializable;
  10. /**
  11.  * AddOns
  12.  *
  13.  * @ORM\Entity
  14.  * @ORM\Table(name="orders_refund")
  15.  * @ORM\HasLifecycleCallbacks()
  16.  */
  17. class Orders_Refund implements JsonSerializable
  18. {
  19.     /**
  20.      * @ORM\Column(type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var Orders
  27.      * @ORM\OneToOne(targetEntity="Orders", inversedBy="order_refund")
  28.      * @ORM\JoinColumn(name="order_id", referencedColumnName="id")
  29.      */
  30.     private $order;
  31.     /**
  32.      * @ORM\Column(type="decimal", precision=10, scale=2)
  33.      * @Assert\NotBlank()
  34.      */
  35.     private $refund_amount;
  36.     /**
  37.      * @ORM\Column(type="string", nullable=true)
  38.      * @Assert\NotBlank()
  39.      */
  40.     private $refund_comment;
  41.     /**
  42.      * @ORM\Column(type="string", nullable=true)
  43.      * @Assert\NotBlank()
  44.      */
  45.     private $refund_status;//BookingStatus Constants for Refund Status
  46.     /**
  47.      * @ORM\Column(type="string", nullable=true)
  48.      * @Assert\NotBlank()
  49.      */
  50.     private $refund_stripe_id;
  51.     /**
  52.      * @var DateTime
  53.      * @ORM\Column(type="datetime", nullable=true)
  54.      * @Assert\NotBlank()
  55.      */
  56.     private $refund_processed_date;
  57.     /**
  58.      * @var DateTime
  59.      * @ORM\Column(type="datetime", nullable=true)
  60.      * @Assert\NotBlank()
  61.      */
  62.     private $refund_initiated_date;
  63.     /**
  64.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  65.      * @Assert\NotBlank()
  66.      */
  67.     private $hold_refund false;
  68.     /**
  69.      * @return mixed
  70.      */
  71.     public function getId()
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * @return Orders
  77.      */
  78.     public function getOrder()
  79.     {
  80.         return $this->order;
  81.     }
  82.     /**
  83.      * @param Orders $order
  84.      */
  85.     public function setOrder(Orders $order)
  86.     {
  87.         $this->order $order;
  88.     }
  89.     /**
  90.      * @return mixed
  91.      */
  92.     public function getRefundAmount()
  93.     {
  94.         return $this->refund_amount;
  95.     }
  96.     /**
  97.      * @param mixed $refund_amount
  98.      */
  99.     public function setRefundAmount($refund_amount)
  100.     {
  101.         $this->refund_amount $refund_amount;
  102.     }
  103.     /**
  104.      * @return mixed
  105.      */
  106.     public function getRefundComment()
  107.     {
  108.         return $this->refund_comment;
  109.     }
  110.     /**
  111.      * @param mixed $refund_comment
  112.      */
  113.     public function setRefundComment($refund_comment)
  114.     {
  115.         $this->refund_comment $refund_comment;
  116.     }
  117.     /**
  118.      * @return mixed
  119.      */
  120.     public function getRefundStatus()
  121.     {
  122.         return $this->refund_status;
  123.     }
  124.     /**
  125.      * @param mixed $refund_status
  126.      */
  127.     public function setRefundStatus($refund_status)
  128.     {
  129.         $this->refund_status $refund_status;
  130.     }
  131.     /**
  132.      * @return mixed
  133.      */
  134.     public function getRefundStripeId()
  135.     {
  136.         return $this->refund_stripe_id;
  137.     }
  138.     /**
  139.      * @param mixed $refund_stripe_id
  140.      */
  141.     public function setRefundStripeId($refund_stripe_id)
  142.     {
  143.         $this->refund_stripe_id $refund_stripe_id;
  144.     }
  145.     /**
  146.      * @return DateTime
  147.      */
  148.     public function getRefundProcessedDate()
  149.     {
  150.         return $this->refund_processed_date;
  151.     }
  152.     /**
  153.      * @param DateTime $refund_processed_date
  154.      */
  155.     public function setRefundProcessedDate(DateTime $refund_processed_date)
  156.     {
  157.         $this->refund_processed_date $refund_processed_date;
  158.     }
  159.     /**
  160.      * @return mixed
  161.      */
  162.     public function getHoldRefund()
  163.     {
  164.         return $this->hold_refund;
  165.     }
  166.     /**
  167.      * @param mixed $hold_refund
  168.      */
  169.     public function setHoldRefund($hold_refund)
  170.     {
  171.         $this->hold_refund $hold_refund;
  172.     }
  173.     /**
  174.      * @return DateTime
  175.      */
  176.     public function getRefundInitiatedDate()
  177.     {
  178.         return $this->refund_initiated_date;
  179.     }
  180.     /**
  181.      * @param DateTime $refund_initiated_date
  182.      */
  183.     public function setRefundInitiatedDate(DateTime $refund_initiated_date)
  184.     {
  185.         $this->refund_initiated_date $refund_initiated_date;
  186.     }
  187.     public function jsonSerialize()
  188.     {
  189.         return array(
  190.             'id' => $this->id,
  191.             'order_id' => $this->order->getId(),
  192.             'refund_amount' => $this->refund_amount,
  193.             'refund_comment' => $this->refund_comment,
  194.             'refund_status' => $this->refund_status,
  195.             'refund_stripe_id' => $this->refund_stripe_id,
  196.             'hold_refund' => $this->hold_refund,
  197.             'refund_processed_date' => $this->refund_processed_date->format('Y-m-d H:i:s'),
  198.             'refund_initiated_date' => $this->refund_initiated_date->format('Y-m-d H:i:s'),
  199.             'created' => $this->createdAt->format('Y-m-d H:i:s'),
  200.             'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
  201.         );
  202.     }
  203.     /**
  204.      * @var DateTime $created
  205.      *
  206.      * @ORM\Column(type="datetime", nullable=false)
  207.      */
  208.     protected $createdAt;
  209.     /**
  210.      * @var DateTime $updated
  211.      *
  212.      * @ORM\Column(type="datetime", nullable=false)
  213.      */
  214.     protected $updatedAt;
  215.     /**
  216.      * @return DateTime
  217.      */
  218.     public function getCreatedAt()
  219.     {
  220.         return $this->createdAt;
  221.     }
  222.     /**
  223.      * @return DateTime
  224.      */
  225.     public function getUpdatedAt()
  226.     {
  227.         return $this->updatedAt;
  228.     }
  229.     public function setUpdatedAt($updatedAt)
  230.     {
  231.         $this->updatedAt $updatedAt;
  232.         return $this;
  233.     }
  234.     /**
  235.      * @ORM\PrePersist
  236.      */
  237.     public function setCreatedAt()
  238.     {
  239.         $this->createdAt = new DateTime();
  240.         $this->updatedAt = new DateTime();
  241.         return $this;
  242.     }
  243.     /**
  244.      * @ORM\PreUpdate
  245.      */
  246.     public function setUpdatedAtValue() {
  247.         $this->updatedAt = new DateTime();
  248.     }
  249.     public function __construct() {
  250.     }
  251. }