src/AppBundle/MainBundle/Entity/Orders_Pricing.php line 805

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: apple
  5.  * Date: 29/03/19
  6.  * Time: 3:06 PM
  7.  */
  8. namespace App\AppBundle\MainBundle\Entity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use JsonSerializable;
  13. /**
  14.  * AddOns
  15.  *
  16.  * @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Orders_PricingRepository")
  17.  * @ORM\Table(name="orders_pricing")
  18.  * @ORM\HasLifecycleCallbacks()
  19.  */
  20. class Orders_Pricing implements JsonSerializable
  21. {
  22.     /**
  23.      * @ORM\Column(type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * One Cart has One Customer.
  30.      * @ORM\OneToOne(targetEntity="Orders", inversedBy="orders_pricing")
  31.      * @ORM\JoinColumn(name="order_id", referencedColumnName="id")
  32.      */
  33.     private $order;
  34.     /**
  35.      * @var PromoCodes
  36.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  37.      * @ORM\JoinColumn(name="promo_code_id", referencedColumnName="id", nullable=true)
  38.      */
  39.     private $promo_code;
  40.     /**
  41.      * One user has many tokens. This is the inverse side.
  42.      * @ORM\OneToMany(targetEntity="Orders_Custom_Pricing", mappedBy="orders")
  43.      */
  44.     private $orders_custom_pricing;
  45.     /**
  46.      * One user has many tokens. This is the inverse side.
  47.      * @ORM\OneToMany(targetEntity="Orders_Special_Pricing", mappedBy="orders")
  48.      */
  49.     private $orders_special_pricing;
  50.     /**
  51.      * @ORM\Column(type="decimal", precision=10, scale=2)
  52.      * @Assert\NotBlank()
  53.      */
  54.     private $hourly_rate;
  55.     /**
  56.      * @ORM\Column(type="decimal", precision=10, scale=2)
  57.      * @Assert\NotBlank()
  58.      */
  59.     private $daily_max;
  60.     /**
  61.      * @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
  62.      * @Assert\NotBlank()
  63.      */
  64.     private $is_custom_rate;
  65.     /**
  66.      * @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
  67.      * @Assert\NotBlank()
  68.      */
  69.     private $is_special_rate;
  70.     /**
  71.      * @ORM\Column(type="decimal", precision=10, scale=2)
  72.      * @Assert\NotBlank()
  73.      */
  74.     private $sub_total_price;
  75.     /**
  76.      * @ORM\Column(type="decimal", precision=10, scale=2)
  77.      * @Assert\NotBlank()
  78.      */
  79.     private $tax_price;
  80.     /**
  81.      * @ORM\Column(type="decimal", precision=10, scale=2)
  82.      * @Assert\NotBlank()
  83.      */
  84.     private $service_fee_price;
  85.     /**
  86.      * @ORM\Column(type="decimal", precision=10, scale=2)
  87.      * @Assert\NotBlank()
  88.      */
  89.     private $total_price;
  90.     /**
  91.      * @ORM\Column(type="decimal", precision=10, scale=2)
  92.      * @Assert\NotBlank()
  93.      */
  94.     private $original_sub_total_price;
  95.     /**
  96.      * @ORM\Column(type="decimal", precision=10, scale=2)
  97.      * @Assert\NotBlank()
  98.      */
  99.     private $original_tax_price;
  100.     /**
  101.      * @ORM\Column(type="decimal", precision=10, scale=2)
  102.      * @Assert\NotBlank()
  103.      */
  104.     private $original_service_fee_price;
  105.     /**
  106.      * @ORM\Column(type="decimal", precision=10, scale=2)
  107.      * @Assert\NotBlank()
  108.      */
  109.     private $original_total_price;
  110.     /**
  111.      * @var string
  112.      * @ORM\Column(type="string", nullable=true)
  113.      */
  114.     private $stripe_charge_id;
  115.     /**
  116.      * @var string
  117.      * @ORM\Column(type="string", nullable=true)
  118.      */
  119.     private $stripe_balance_transaction;
  120.     /**
  121.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  122.      */
  123.     private $stripe_total_amount;
  124.     /**
  125.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  126.      */
  127.     private $stripe_fee_amount;
  128.     /**
  129.      * @var string
  130.      * @ORM\Column(type="string", nullable=true)
  131.      */
  132.     private $stripe_currency;
  133.     /**
  134.      * @var string
  135.      * @ORM\Column(type="string", nullable=true)
  136.      */
  137.     private $stripe_exchange_rate;
  138.     /**
  139.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  140.      */
  141.     private $stripe_net_amount;
  142.     /**
  143.      * @var string
  144.      * @ORM\Column(type="string", nullable=true, length=2000)
  145.      */
  146.     private $stripe_fee_details;
  147.     /**
  148.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  149.      */
  150.     private $is_stripe_balance_transaction_details_updated false;
  151.     /**
  152.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  153.      */
  154.     private $is_discount_applicable false;
  155.     /**
  156.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  157.      */
  158.     private $discount_total 0;
  159.     /**
  160.      * @ORM\Column(type="string", length = 5000, nullable=true)
  161.      */
  162.     private $invoice;
  163.     /**
  164.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  165.      */
  166.     private $without_discount_sub_total_price 0;
  167.     /**
  168.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  169.      */
  170.     private $without_discount_tax_price 0;
  171.     /**
  172.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  173.      */
  174.     private $without_discount_service_fee_price 0;
  175.     /**
  176.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  177.      */
  178.     private $without_discount_total_price 0;
  179.     /**
  180.      * @return mixed
  181.      */
  182.     public function getId()
  183.     {
  184.         return $this->id;
  185.     }
  186.     /**
  187.      * @return Orders
  188.      */
  189.     public function getOrder()
  190.     {
  191.         return $this->order;
  192.     }
  193.     /**
  194.      * @param mixed $order
  195.      */
  196.     public function setOrder($order)
  197.     {
  198.         $this->order $order;
  199.     }
  200.     /**
  201.      * @return mixed
  202.      */
  203.     public function getOrdersCustomPricing()
  204.     {
  205.         return $this->orders_custom_pricing;
  206.     }
  207.     /**
  208.      * @param mixed $orders_custom_pricing
  209.      */
  210.     public function setOrdersCustomPricing($orders_custom_pricing)
  211.     {
  212.         $this->orders_custom_pricing $orders_custom_pricing;
  213.     }
  214.     /**
  215.      * @return mixed
  216.      */
  217.     public function getOrdersSpecialPricing()
  218.     {
  219.         return $this->orders_special_pricing;
  220.     }
  221.     /**
  222.      * @param mixed $orders_special_pricing
  223.      */
  224.     public function setOrdersSpecialPricing($orders_special_pricing)
  225.     {
  226.         $this->orders_special_pricing $orders_special_pricing;
  227.     }
  228.     /**
  229.      * @return mixed
  230.      */
  231.     public function getHourlyRate()
  232.     {
  233.         return $this->hourly_rate;
  234.     }
  235.     /**
  236.      * @param mixed $hourly_rate
  237.      */
  238.     public function setHourlyRate($hourly_rate)
  239.     {
  240.         $this->hourly_rate $hourly_rate;
  241.     }
  242.     /**
  243.      * @return mixed
  244.      */
  245.     public function getDailyMax()
  246.     {
  247.         return $this->daily_max;
  248.     }
  249.     /**
  250.      * @param mixed $daily_max
  251.      */
  252.     public function setDailyMax($daily_max)
  253.     {
  254.         $this->daily_max $daily_max;
  255.     }
  256.     /**
  257.      * @return mixed
  258.      */
  259.     public function getIsCustomRate()
  260.     {
  261.         return $this->is_custom_rate;
  262.     }
  263.     /**
  264.      * @param mixed $is_custom_rate
  265.      */
  266.     public function setIsCustomRate($is_custom_rate)
  267.     {
  268.         $this->is_custom_rate $is_custom_rate;
  269.     }
  270.     /**
  271.      * @return mixed
  272.      */
  273.     public function getIsSpecialRate()
  274.     {
  275.         return $this->is_special_rate;
  276.     }
  277.     /**
  278.      * @param mixed $is_special_rate
  279.      */
  280.     public function setIsSpecialRate($is_special_rate)
  281.     {
  282.         $this->is_special_rate $is_special_rate;
  283.     }
  284.     /**
  285.      * @return mixed
  286.      */
  287.     public function getSubTotalPrice()
  288.     {
  289.         return $this->sub_total_price;
  290.     }
  291.     /**
  292.      * @param mixed $sub_total_price
  293.      */
  294.     public function setSubTotalPrice($sub_total_price)
  295.     {
  296.         $this->sub_total_price $sub_total_price;
  297.     }
  298.     /**
  299.      * @return mixed
  300.      */
  301.     public function getTaxPrice()
  302.     {
  303.         return $this->tax_price;
  304.     }
  305.     /**
  306.      * @param mixed $tax_price
  307.      */
  308.     public function setTaxPrice($tax_price)
  309.     {
  310.         $this->tax_price $tax_price;
  311.     }
  312.     /**
  313.      * @return mixed
  314.      */
  315.     public function getServiceFeePrice()
  316.     {
  317.         return $this->service_fee_price;
  318.     }
  319.     /**
  320.      * @param mixed $service_fee_price
  321.      */
  322.     public function setServiceFeePrice($service_fee_price)
  323.     {
  324.         $this->service_fee_price $service_fee_price;
  325.     }
  326.     /**
  327.      * @return mixed
  328.      */
  329.     public function getTotalPrice()
  330.     {
  331.         return $this->total_price;
  332.     }
  333.     /**
  334.      * @param mixed $total_price
  335.      */
  336.     public function setTotalPrice($total_price)
  337.     {
  338.         $this->total_price $total_price;
  339.     }
  340.     /**
  341.      * @return mixed
  342.      */
  343.     public function getOriginalSubTotalPrice()
  344.     {
  345.         return $this->original_sub_total_price;
  346.     }
  347.     /**
  348.      * @param mixed $original_sub_total_price
  349.      */
  350.     public function setOriginalSubTotalPrice($original_sub_total_price)
  351.     {
  352.         $this->original_sub_total_price $original_sub_total_price;
  353.     }
  354.     /**
  355.      * @return mixed
  356.      */
  357.     public function getOriginalTaxPrice()
  358.     {
  359.         return $this->original_tax_price;
  360.     }
  361.     /**
  362.      * @param mixed $original_tax_price
  363.      */
  364.     public function setOriginalTaxPrice($original_tax_price)
  365.     {
  366.         $this->original_tax_price $original_tax_price;
  367.     }
  368.     /**
  369.      * @return mixed
  370.      */
  371.     public function getOriginalServiceFeePrice()
  372.     {
  373.         return $this->original_service_fee_price;
  374.     }
  375.     /**
  376.      * @param mixed $original_service_fee_price
  377.      */
  378.     public function setOriginalServiceFeePrice($original_service_fee_price)
  379.     {
  380.         $this->original_service_fee_price $original_service_fee_price;
  381.     }
  382.     /**
  383.      * @return mixed
  384.      */
  385.     public function getOriginalTotalPrice()
  386.     {
  387.         return $this->original_total_price;
  388.     }
  389.     /**
  390.      * @param mixed $original_total_price
  391.      */
  392.     public function setOriginalTotalPrice($original_total_price)
  393.     {
  394.         $this->original_total_price $original_total_price;
  395.     }
  396.     /**
  397.      * @return string
  398.      */
  399.     public function getStripeChargeId()
  400.     {
  401.         return $this->stripe_charge_id;
  402.     }
  403.     /**
  404.      * @param string $stripe_charge_id
  405.      */
  406.     public function setStripeChargeId($stripe_charge_id)
  407.     {
  408.         $this->stripe_charge_id $stripe_charge_id;
  409.     }
  410.     /**
  411.      * @return string
  412.      */
  413.     public function getStripeBalanceTransaction()
  414.     {
  415.         return $this->stripe_balance_transaction;
  416.     }
  417.     /**
  418.      * @param string $stripe_balance_transaction
  419.      */
  420.     public function setStripeBalanceTransaction($stripe_balance_transaction)
  421.     {
  422.         $this->stripe_balance_transaction $stripe_balance_transaction;
  423.     }
  424.     /**
  425.      * @return mixed
  426.      */
  427.     public function getStripeTotalAmount()
  428.     {
  429.         return $this->stripe_total_amount;
  430.     }
  431.     /**
  432.      * @param mixed $stripe_total_amount
  433.      */
  434.     public function setStripeTotalAmount($stripe_total_amount)
  435.     {
  436.         $this->stripe_total_amount $stripe_total_amount;
  437.     }
  438.     /**
  439.      * @return mixed
  440.      */
  441.     public function getStripeFeeAmount()
  442.     {
  443.         return $this->stripe_fee_amount;
  444.     }
  445.     /**
  446.      * @param mixed $stripe_fee_amount
  447.      */
  448.     public function setStripeFeeAmount($stripe_fee_amount)
  449.     {
  450.         $this->stripe_fee_amount $stripe_fee_amount;
  451.     }
  452.     /**
  453.      * @return string
  454.      */
  455.     public function getStripeCurrency()
  456.     {
  457.         return $this->stripe_currency;
  458.     }
  459.     /**
  460.      * @param string $stripe_currency
  461.      */
  462.     public function setStripeCurrency($stripe_currency)
  463.     {
  464.         $this->stripe_currency $stripe_currency;
  465.     }
  466.     /**
  467.      * @return string
  468.      */
  469.     public function getStripeExchangeRate()
  470.     {
  471.         return $this->stripe_exchange_rate;
  472.     }
  473.     /**
  474.      * @param string $stripe_exchange_rate
  475.      */
  476.     public function setStripeExchangeRate($stripe_exchange_rate)
  477.     {
  478.         $this->stripe_exchange_rate $stripe_exchange_rate;
  479.     }
  480.     /**
  481.      * @return mixed
  482.      */
  483.     public function getStripeNetAmount()
  484.     {
  485.         return $this->stripe_net_amount;
  486.     }
  487.     /**
  488.      * @param mixed $stripe_net_amount
  489.      */
  490.     public function setStripeNetAmount($stripe_net_amount)
  491.     {
  492.         $this->stripe_net_amount $stripe_net_amount;
  493.     }
  494.     /**
  495.      * @return string
  496.      */
  497.     public function getStripeFeeDetails()
  498.     {
  499.         return $this->stripe_fee_details;
  500.     }
  501.     /**
  502.      * @param string $stripe_fee_details
  503.      */
  504.     public function setStripeFeeDetails($stripe_fee_details)
  505.     {
  506.         $this->stripe_fee_details $stripe_fee_details;
  507.     }
  508.     /**
  509.      * @return mixed
  510.      */
  511.     public function getIsStripeBalanceTransactionDetailsUpdated()
  512.     {
  513.         return $this->is_stripe_balance_transaction_details_updated;
  514.     }
  515.     /**
  516.      * @param mixed $is_stripe_balance_transaction_details_updated
  517.      */
  518.     public function setIsStripeBalanceTransactionDetailsUpdated($is_stripe_balance_transaction_details_updated)
  519.     {
  520.         $this->is_stripe_balance_transaction_details_updated $is_stripe_balance_transaction_details_updated;
  521.     }
  522.     /**
  523.      * @return PromoCodes
  524.      */
  525.     public function getPromoCode()
  526.     {
  527.         return $this->promo_code;
  528.     }
  529.     /**
  530.      * @param PromoCodes $promo_code
  531.      */
  532.     public function setPromoCode(PromoCodes $promo_code)
  533.     {
  534.         $this->promo_code $promo_code;
  535.     }
  536.     /**
  537.      * @return mixed
  538.      */
  539.     public function getIsDiscountApplicable()
  540.     {
  541.         return $this->is_discount_applicable;
  542.     }
  543.     /**
  544.      * @param mixed $is_discount_applicable
  545.      */
  546.     public function setIsDiscountApplicable($is_discount_applicable)
  547.     {
  548.         $this->is_discount_applicable $is_discount_applicable;
  549.     }
  550.     /**
  551.      * @return mixed
  552.      */
  553.     public function getDiscountTotal()
  554.     {
  555.         return $this->discount_total;
  556.     }
  557.     /**
  558.      * @param mixed $discount_total
  559.      */
  560.     public function setDiscountTotal($discount_total)
  561.     {
  562.         $this->discount_total $discount_total;
  563.     }
  564.     /**
  565.      * @return mixed
  566.      */
  567.     public function getInvoice()
  568.     {
  569.         return $this->invoice;
  570.     }
  571.     /**
  572.      * @param mixed $invoice
  573.      */
  574.     public function setInvoice($invoice)
  575.     {
  576.         $this->invoice $invoice;
  577.     }
  578.     /**
  579.      * @return mixed
  580.      */
  581.     public function getWithoutDiscountSubTotalPrice()
  582.     {
  583.         return $this->without_discount_sub_total_price;
  584.     }
  585.     /**
  586.      * @param mixed $without_discount_sub_total_price
  587.      */
  588.     public function setWithoutDiscountSubTotalPrice($without_discount_sub_total_price)
  589.     {
  590.         $this->without_discount_sub_total_price $without_discount_sub_total_price;
  591.     }
  592.     /**
  593.      * @return mixed
  594.      */
  595.     public function getWithoutDiscountTaxPrice()
  596.     {
  597.         return $this->without_discount_tax_price;
  598.     }
  599.     /**
  600.      * @param mixed $without_discount_tax_price
  601.      */
  602.     public function setWithoutDiscountTaxPrice($without_discount_tax_price)
  603.     {
  604.         $this->without_discount_tax_price $without_discount_tax_price;
  605.     }
  606.     /**
  607.      * @return mixed
  608.      */
  609.     public function getWithoutDiscountServiceFeePrice()
  610.     {
  611.         return $this->without_discount_service_fee_price;
  612.     }
  613.     /**
  614.      * @param mixed $without_discount_service_fee_price
  615.      */
  616.     public function setWithoutDiscountServiceFeePrice($without_discount_service_fee_price)
  617.     {
  618.         $this->without_discount_service_fee_price $without_discount_service_fee_price;
  619.     }
  620.     /**
  621.      * @return mixed
  622.      */
  623.     public function getWithoutDiscountTotalPrice()
  624.     {
  625.         return $this->without_discount_total_price;
  626.     }
  627.     /**
  628.      * @param mixed $without_discount_total_price
  629.      */
  630.     public function setWithoutDiscountTotalPrice($without_discount_total_price)
  631.     {
  632.         $this->without_discount_total_price $without_discount_total_price;
  633.     }
  634.     public function jsonSerialize()
  635.     {
  636.         return array(
  637.             'id' => $this->id,
  638.             'hourly_rate' => $this->hourly_rate,
  639.             'daily_max' => $this->daily_max,
  640.             'total_price' => $this->total_price,
  641.             'orders_special_pricing' => $this->orders_special_pricing,
  642.             'orders_custom_pricing' => $this->orders_custom_pricing,
  643.             'is_custom_rate' => $this->is_custom_rate,
  644.             'is_special_rate' => $this->is_special_rate,
  645.             'service_fee_price' => $this->service_fee_price,
  646.             'sub_total_price' => $this->sub_total_price,
  647.             'tax_price' => $this->tax_price,
  648.             'original_service_fee_price' => $this->original_service_fee_price,
  649.             'original_sub_total_price' => $this->original_sub_total_price,
  650.             'original_tax_price' => $this->original_tax_price,
  651.             'original_total_price' => $this->original_total_price,
  652.             'without_discount_service_fee_price' => $this->without_discount_service_fee_price,
  653.             'without_discount_sub_total_price' => $this->without_discount_sub_total_price,
  654.             'without_discount_tax_price' => $this->without_discount_tax_price,
  655.             'without_discount_total_price' => $this->without_discount_total_price,
  656.             'stripe_charge_id' => $this->stripe_charge_id,
  657.             'stripe_balance_transaction' => $this->stripe_balance_transaction,
  658.             'stripe_currency' => $this->stripe_currency,
  659.             'stripe_exchange_rate' => $this->stripe_exchange_rate,
  660.             'stripe_fee_amount' => $this->stripe_fee_amount,
  661.             'stripe_total_amount' => $this->stripe_total_amount,
  662.             'stripe_net_amount' => $this->stripe_net_amount,
  663.             'is_discount_applicable' => $this->is_discount_applicable,
  664.             'discount_total' => $this->discount_total,
  665.             'promo_code' => $this->getPromoCode() != NULL $this->getPromoCode()->jsonSerialize() : NULL,
  666.             'is_stripe_balance_transaction_details_updated' => $this->is_stripe_balance_transaction_details_updated,
  667.             'invoice' => $this->invoice,
  668.         );
  669.     }
  670.     /**
  671.      * @var string $created
  672.      *
  673.      * @ORM\Column(name="created_at", type="string", nullable=false)
  674.      */
  675.     protected $createdAt;
  676.     /**
  677.      * @var string $updated
  678.      *
  679.      * @ORM\Column(name="updated_at", type="string", nullable=false)
  680.      */
  681.     protected $updatedAt;
  682.     public function getCreatedAt()
  683.     {
  684.         return $this->createdAt;
  685.     }
  686.     public function setCreatedAt($createdAt)
  687.     {
  688.         $this->createdAt $createdAt;
  689.         return $this;
  690.     }
  691.     public function getUpdatedAt()
  692.     {
  693.         return $this->updatedAt;
  694.     }
  695.     public function setUpdatedAt($updatedAt)
  696.     {
  697.         $this->updatedAt $updatedAt;
  698.         return $this;
  699.     }
  700.     /**
  701.      * @ORM\PrePersist
  702.      * @ORM\PreUpdate
  703.      */
  704.     public function updatedTimestamps()
  705.     {
  706.         $this->setUpdatedAt(round(microtime(true) * 1000));
  707.         if ($this->getCreatedAt() === null) {
  708.             $this->setCreatedAt(round(microtime(true) * 1000));
  709.         }
  710.     }
  711.     public function __construct() {
  712.         $this->orders_custom_pricing = new ArrayCollection();
  713.         $this->orders_special_pricing = new ArrayCollection();
  714.         $this->setCreatedAt(round(microtime(true) * 1000));
  715.     }
  716. }