src/AppBundle/MainBundle/Entity/Orders_Suppliers_Transfer_Charge.php line 299

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 JsonSerializable;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * AddOns
  11.  *
  12.  * @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Orders_Suppliers_Transfer_ChargeRepository")
  13.  * @ORM\Table(name="orders_suppliers_transfer_charge")
  14.  * @ORM\HasLifecycleCallbacks()
  15.  */
  16. class Orders_Suppliers_Transfer_Charge implements JsonSerializable
  17. {
  18.     /**
  19.      * @ORM\Column(type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var Orders_Suppliers_Transfers_Payout
  26.      * @ORM\ManyToOne(targetEntity="Orders_Suppliers_Transfers_Payout", inversedBy="order_supplier_transfers_charges")
  27.      * @ORM\JoinColumn(name="order_supplier_transfers_payout_id", referencedColumnName="id", nullable=true)
  28.      */
  29.     private $orders_suppliers_transfers_payout;
  30.     /**
  31.      * @var User
  32.      * @ORM\ManyToOne(targetEntity="User")
  33.      * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id")
  34.      */
  35.     private $supplier;
  36.     /**
  37.      * @ORM\Column(type="decimal", precision=10, scale=2)
  38.      * @Assert\NotBlank()
  39.      */
  40.     private $amount;
  41.     /**
  42.      * @ORM\Column(type="string", nullable=false)
  43.      * @Assert\NotBlank()
  44.      */
  45.     private $currency;
  46.     /**
  47.      * @ORM\Column(type="string", nullable=true)
  48.      * @Assert\NotBlank()
  49.      */
  50.     private $comment;
  51.     /**
  52.      * @ORM\Column(type="string", nullable=true)
  53.      * @Assert\NotBlank()
  54.      */
  55.     private $status;
  56.     /**
  57.      * @ORM\Column(type="string", nullable=true)
  58.      * @Assert\NotBlank()
  59.      */
  60.     private $type;//0 - Manual Payout
  61.     /**
  62.      * @ORM\Column(type="string", nullable=true)
  63.      * @Assert\NotBlank()
  64.      */
  65.     private $stripe_charge_id;
  66.     /**
  67.      * @var DateTime
  68.      * @ORM\Column(type="datetime", nullable=true)
  69.      * @Assert\NotBlank()
  70.      */
  71.     private $processed_date;
  72.     /**
  73.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  74.      * @Assert\NotBlank()
  75.      */
  76.     private $hold false;
  77.     /**
  78.      * @return mixed
  79.      */
  80.     public function getId()
  81.     {
  82.         return $this->id;
  83.     }
  84.     /**
  85.      * @return Orders_Suppliers_Transfers_Payout
  86.      */
  87.     public function getOrdersSuppliersTransfersPayout()
  88.     {
  89.         return $this->orders_suppliers_transfers_payout;
  90.     }
  91.     /**
  92.      * @param Orders_Suppliers_Transfers_Payout $orders_suppliers_transfers_payout
  93.      */
  94.     public function setOrdersSuppliersTransfersPayout($orders_suppliers_transfers_payout)
  95.     {
  96.         $this->orders_suppliers_transfers_payout $orders_suppliers_transfers_payout;
  97.     }
  98.     /**
  99.      * @return mixed
  100.      */
  101.     public function getAmount()
  102.     {
  103.         return $this->amount;
  104.     }
  105.     /**
  106.      * @param mixed $amount
  107.      */
  108.     public function setAmount($amount)
  109.     {
  110.         $this->amount $amount;
  111.     }
  112.     /**
  113.      * @return mixed
  114.      */
  115.     public function getComment()
  116.     {
  117.         return $this->comment;
  118.     }
  119.     /**
  120.      * @param mixed $comment
  121.      */
  122.     public function setComment($comment)
  123.     {
  124.         $this->comment $comment;
  125.     }
  126.     /**
  127.      * @return mixed
  128.      */
  129.     public function getStatus()
  130.     {
  131.         return $this->status;
  132.     }
  133.     /**
  134.      * @param mixed $status
  135.      */
  136.     public function setStatus($status)
  137.     {
  138.         $this->status $status;
  139.     }
  140.     /**
  141.      * @return mixed
  142.      */
  143.     public function getType()
  144.     {
  145.         return $this->type;
  146.     }
  147.     /**
  148.      * @param mixed $type
  149.      */
  150.     public function setType($type)
  151.     {
  152.         $this->type $type;
  153.     }
  154.     /**
  155.      * @return mixed
  156.      */
  157.     public function getStripeChargeId()
  158.     {
  159.         return $this->stripe_charge_id;
  160.     }
  161.     /**
  162.      * @param mixed $stripe_charge_id
  163.      */
  164.     public function setStripeChargeId($stripe_charge_id)
  165.     {
  166.         $this->stripe_charge_id $stripe_charge_id;
  167.     }
  168.     /**
  169.      * @return DateTime
  170.      */
  171.     public function getProcessedDate()
  172.     {
  173.         return $this->processed_date;
  174.     }
  175.     /**
  176.      * @param DateTime $processed_date
  177.      */
  178.     public function setProcessedDate($processed_date)
  179.     {
  180.         $this->processed_date $processed_date;
  181.     }
  182.     /**
  183.      * @return mixed
  184.      */
  185.     public function getHold()
  186.     {
  187.         return $this->hold;
  188.     }
  189.     /**
  190.      * @param mixed $hold
  191.      */
  192.     public function setHold($hold)
  193.     {
  194.         $this->hold $hold;
  195.     }
  196.     /**
  197.      * @return User
  198.      */
  199.     public function getSupplier()
  200.     {
  201.         return $this->supplier;
  202.     }
  203.     /**
  204.      * @param User $supplier
  205.      */
  206.     public function setSupplier($supplier)
  207.     {
  208.         $this->supplier $supplier;
  209.     }
  210.     /**
  211.      * @return mixed
  212.      */
  213.     public function getCurrency()
  214.     {
  215.         return $this->currency;
  216.     }
  217.     /**
  218.      * @param mixed $currency
  219.      */
  220.     public function setCurrency($currency)
  221.     {
  222.         $this->currency $currency;
  223.     }
  224.     public function jsonSerialize()
  225.     {
  226.         return array(
  227.             'id' => $this->id,
  228.             'supplier_id' => $this->supplier->getId(),
  229.             'currency' => $this->currency,
  230.             'amount' => $this->amount,
  231.             'comment' => $this->comment,
  232.             'status' => $this->status,
  233.             'type' => $this->type,
  234.             'hold' => $this->hold,
  235.             'stripe_charge_id' => $this->stripe_charge_id,
  236.             'processed_date' => $this->processed_date->format('Y-m-d H:i:s'),
  237.             'created' => $this->createdAt->format('Y-m-d H:i:s'),
  238.             'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
  239.         );
  240.     }
  241.     /**
  242.      * @var DateTime $created
  243.      *
  244.      * @ORM\Column(type="datetime", nullable=false)
  245.      */
  246.     protected $createdAt;
  247.     /**
  248.      * @var DateTime $updated
  249.      *
  250.      * @ORM\Column(type="datetime", nullable=false)
  251.      */
  252.     protected $updatedAt;
  253.     /**
  254.      * @return DateTime
  255.      */
  256.     public function getCreatedAt()
  257.     {
  258.         return $this->createdAt;
  259.     }
  260.     /**
  261.      * @return DateTime
  262.      */
  263.     public function getUpdatedAt()
  264.     {
  265.         return $this->updatedAt;
  266.     }
  267.     public function setUpdatedAt($updatedAt)
  268.     {
  269.         $this->updatedAt $updatedAt;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @ORM\PrePersist
  274.      */
  275.     public function setCreatedAt()
  276.     {
  277.         $this->createdAt = new DateTime();
  278.         $this->updatedAt = new DateTime();
  279.         return $this;
  280.     }
  281.     /**
  282.      * @ORM\PreUpdate
  283.      */
  284.     public function setUpdatedAtValue() {
  285.         $this->updatedAt = new DateTime();
  286.     }
  287.     public function __construct() {
  288.     }
  289. }