<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 29/03/19
* Time: 3:06 PM
*/
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Orders_PricingRepository")
* @ORM\Table(name="orders_pricing")
* @ORM\HasLifecycleCallbacks()
*/
class Orders_Pricing implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* One Cart has One Customer.
* @ORM\OneToOne(targetEntity="Orders", inversedBy="orders_pricing")
* @ORM\JoinColumn(name="order_id", referencedColumnName="id")
*/
private $order;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="promo_code_id", referencedColumnName="id", nullable=true)
*/
private $promo_code;
/**
* One user has many tokens. This is the inverse side.
* @ORM\OneToMany(targetEntity="Orders_Custom_Pricing", mappedBy="orders")
*/
private $orders_custom_pricing;
/**
* One user has many tokens. This is the inverse side.
* @ORM\OneToMany(targetEntity="Orders_Special_Pricing", mappedBy="orders")
*/
private $orders_special_pricing;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $hourly_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $daily_max;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is_custom_rate;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is_special_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $sub_total_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $tax_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $service_fee_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $total_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $original_sub_total_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $original_tax_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $original_service_fee_price;
/**
* @ORM\Column(type="decimal", precision=10, scale=2)
* @Assert\NotBlank()
*/
private $original_total_price;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
*/
private $stripe_charge_id;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
*/
private $stripe_balance_transaction;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $stripe_total_amount;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $stripe_fee_amount;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
*/
private $stripe_currency;
/**
* @var string
* @ORM\Column(type="string", nullable=true)
*/
private $stripe_exchange_rate;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $stripe_net_amount;
/**
* @var string
* @ORM\Column(type="string", nullable=true, length=2000)
*/
private $stripe_fee_details;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
*/
private $is_stripe_balance_transaction_details_updated = false;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
*/
private $is_discount_applicable = false;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $discount_total = 0;
/**
* @ORM\Column(type="string", length = 5000, nullable=true)
*/
private $invoice;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $without_discount_sub_total_price = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $without_discount_tax_price = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $without_discount_service_fee_price = 0;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $without_discount_total_price = 0;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return Orders
*/
public function getOrder()
{
return $this->order;
}
/**
* @param mixed $order
*/
public function setOrder($order)
{
$this->order = $order;
}
/**
* @return mixed
*/
public function getOrdersCustomPricing()
{
return $this->orders_custom_pricing;
}
/**
* @param mixed $orders_custom_pricing
*/
public function setOrdersCustomPricing($orders_custom_pricing)
{
$this->orders_custom_pricing = $orders_custom_pricing;
}
/**
* @return mixed
*/
public function getOrdersSpecialPricing()
{
return $this->orders_special_pricing;
}
/**
* @param mixed $orders_special_pricing
*/
public function setOrdersSpecialPricing($orders_special_pricing)
{
$this->orders_special_pricing = $orders_special_pricing;
}
/**
* @return mixed
*/
public function getHourlyRate()
{
return $this->hourly_rate;
}
/**
* @param mixed $hourly_rate
*/
public function setHourlyRate($hourly_rate)
{
$this->hourly_rate = $hourly_rate;
}
/**
* @return mixed
*/
public function getDailyMax()
{
return $this->daily_max;
}
/**
* @param mixed $daily_max
*/
public function setDailyMax($daily_max)
{
$this->daily_max = $daily_max;
}
/**
* @return mixed
*/
public function getIsCustomRate()
{
return $this->is_custom_rate;
}
/**
* @param mixed $is_custom_rate
*/
public function setIsCustomRate($is_custom_rate)
{
$this->is_custom_rate = $is_custom_rate;
}
/**
* @return mixed
*/
public function getIsSpecialRate()
{
return $this->is_special_rate;
}
/**
* @param mixed $is_special_rate
*/
public function setIsSpecialRate($is_special_rate)
{
$this->is_special_rate = $is_special_rate;
}
/**
* @return mixed
*/
public function getSubTotalPrice()
{
return $this->sub_total_price;
}
/**
* @param mixed $sub_total_price
*/
public function setSubTotalPrice($sub_total_price)
{
$this->sub_total_price = $sub_total_price;
}
/**
* @return mixed
*/
public function getTaxPrice()
{
return $this->tax_price;
}
/**
* @param mixed $tax_price
*/
public function setTaxPrice($tax_price)
{
$this->tax_price = $tax_price;
}
/**
* @return mixed
*/
public function getServiceFeePrice()
{
return $this->service_fee_price;
}
/**
* @param mixed $service_fee_price
*/
public function setServiceFeePrice($service_fee_price)
{
$this->service_fee_price = $service_fee_price;
}
/**
* @return mixed
*/
public function getTotalPrice()
{
return $this->total_price;
}
/**
* @param mixed $total_price
*/
public function setTotalPrice($total_price)
{
$this->total_price = $total_price;
}
/**
* @return mixed
*/
public function getOriginalSubTotalPrice()
{
return $this->original_sub_total_price;
}
/**
* @param mixed $original_sub_total_price
*/
public function setOriginalSubTotalPrice($original_sub_total_price)
{
$this->original_sub_total_price = $original_sub_total_price;
}
/**
* @return mixed
*/
public function getOriginalTaxPrice()
{
return $this->original_tax_price;
}
/**
* @param mixed $original_tax_price
*/
public function setOriginalTaxPrice($original_tax_price)
{
$this->original_tax_price = $original_tax_price;
}
/**
* @return mixed
*/
public function getOriginalServiceFeePrice()
{
return $this->original_service_fee_price;
}
/**
* @param mixed $original_service_fee_price
*/
public function setOriginalServiceFeePrice($original_service_fee_price)
{
$this->original_service_fee_price = $original_service_fee_price;
}
/**
* @return mixed
*/
public function getOriginalTotalPrice()
{
return $this->original_total_price;
}
/**
* @param mixed $original_total_price
*/
public function setOriginalTotalPrice($original_total_price)
{
$this->original_total_price = $original_total_price;
}
/**
* @return string
*/
public function getStripeChargeId()
{
return $this->stripe_charge_id;
}
/**
* @param string $stripe_charge_id
*/
public function setStripeChargeId($stripe_charge_id)
{
$this->stripe_charge_id = $stripe_charge_id;
}
/**
* @return string
*/
public function getStripeBalanceTransaction()
{
return $this->stripe_balance_transaction;
}
/**
* @param string $stripe_balance_transaction
*/
public function setStripeBalanceTransaction($stripe_balance_transaction)
{
$this->stripe_balance_transaction = $stripe_balance_transaction;
}
/**
* @return mixed
*/
public function getStripeTotalAmount()
{
return $this->stripe_total_amount;
}
/**
* @param mixed $stripe_total_amount
*/
public function setStripeTotalAmount($stripe_total_amount)
{
$this->stripe_total_amount = $stripe_total_amount;
}
/**
* @return mixed
*/
public function getStripeFeeAmount()
{
return $this->stripe_fee_amount;
}
/**
* @param mixed $stripe_fee_amount
*/
public function setStripeFeeAmount($stripe_fee_amount)
{
$this->stripe_fee_amount = $stripe_fee_amount;
}
/**
* @return string
*/
public function getStripeCurrency()
{
return $this->stripe_currency;
}
/**
* @param string $stripe_currency
*/
public function setStripeCurrency($stripe_currency)
{
$this->stripe_currency = $stripe_currency;
}
/**
* @return string
*/
public function getStripeExchangeRate()
{
return $this->stripe_exchange_rate;
}
/**
* @param string $stripe_exchange_rate
*/
public function setStripeExchangeRate($stripe_exchange_rate)
{
$this->stripe_exchange_rate = $stripe_exchange_rate;
}
/**
* @return mixed
*/
public function getStripeNetAmount()
{
return $this->stripe_net_amount;
}
/**
* @param mixed $stripe_net_amount
*/
public function setStripeNetAmount($stripe_net_amount)
{
$this->stripe_net_amount = $stripe_net_amount;
}
/**
* @return string
*/
public function getStripeFeeDetails()
{
return $this->stripe_fee_details;
}
/**
* @param string $stripe_fee_details
*/
public function setStripeFeeDetails($stripe_fee_details)
{
$this->stripe_fee_details = $stripe_fee_details;
}
/**
* @return mixed
*/
public function getIsStripeBalanceTransactionDetailsUpdated()
{
return $this->is_stripe_balance_transaction_details_updated;
}
/**
* @param mixed $is_stripe_balance_transaction_details_updated
*/
public function setIsStripeBalanceTransactionDetailsUpdated($is_stripe_balance_transaction_details_updated)
{
$this->is_stripe_balance_transaction_details_updated = $is_stripe_balance_transaction_details_updated;
}
/**
* @return PromoCodes
*/
public function getPromoCode()
{
return $this->promo_code;
}
/**
* @param PromoCodes $promo_code
*/
public function setPromoCode(PromoCodes $promo_code)
{
$this->promo_code = $promo_code;
}
/**
* @return mixed
*/
public function getIsDiscountApplicable()
{
return $this->is_discount_applicable;
}
/**
* @param mixed $is_discount_applicable
*/
public function setIsDiscountApplicable($is_discount_applicable)
{
$this->is_discount_applicable = $is_discount_applicable;
}
/**
* @return mixed
*/
public function getDiscountTotal()
{
return $this->discount_total;
}
/**
* @param mixed $discount_total
*/
public function setDiscountTotal($discount_total)
{
$this->discount_total = $discount_total;
}
/**
* @return mixed
*/
public function getInvoice()
{
return $this->invoice;
}
/**
* @param mixed $invoice
*/
public function setInvoice($invoice)
{
$this->invoice = $invoice;
}
/**
* @return mixed
*/
public function getWithoutDiscountSubTotalPrice()
{
return $this->without_discount_sub_total_price;
}
/**
* @param mixed $without_discount_sub_total_price
*/
public function setWithoutDiscountSubTotalPrice($without_discount_sub_total_price)
{
$this->without_discount_sub_total_price = $without_discount_sub_total_price;
}
/**
* @return mixed
*/
public function getWithoutDiscountTaxPrice()
{
return $this->without_discount_tax_price;
}
/**
* @param mixed $without_discount_tax_price
*/
public function setWithoutDiscountTaxPrice($without_discount_tax_price)
{
$this->without_discount_tax_price = $without_discount_tax_price;
}
/**
* @return mixed
*/
public function getWithoutDiscountServiceFeePrice()
{
return $this->without_discount_service_fee_price;
}
/**
* @param mixed $without_discount_service_fee_price
*/
public function setWithoutDiscountServiceFeePrice($without_discount_service_fee_price)
{
$this->without_discount_service_fee_price = $without_discount_service_fee_price;
}
/**
* @return mixed
*/
public function getWithoutDiscountTotalPrice()
{
return $this->without_discount_total_price;
}
/**
* @param mixed $without_discount_total_price
*/
public function setWithoutDiscountTotalPrice($without_discount_total_price)
{
$this->without_discount_total_price = $without_discount_total_price;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'hourly_rate' => $this->hourly_rate,
'daily_max' => $this->daily_max,
'total_price' => $this->total_price,
'orders_special_pricing' => $this->orders_special_pricing,
'orders_custom_pricing' => $this->orders_custom_pricing,
'is_custom_rate' => $this->is_custom_rate,
'is_special_rate' => $this->is_special_rate,
'service_fee_price' => $this->service_fee_price,
'sub_total_price' => $this->sub_total_price,
'tax_price' => $this->tax_price,
'original_service_fee_price' => $this->original_service_fee_price,
'original_sub_total_price' => $this->original_sub_total_price,
'original_tax_price' => $this->original_tax_price,
'original_total_price' => $this->original_total_price,
'without_discount_service_fee_price' => $this->without_discount_service_fee_price,
'without_discount_sub_total_price' => $this->without_discount_sub_total_price,
'without_discount_tax_price' => $this->without_discount_tax_price,
'without_discount_total_price' => $this->without_discount_total_price,
'stripe_charge_id' => $this->stripe_charge_id,
'stripe_balance_transaction' => $this->stripe_balance_transaction,
'stripe_currency' => $this->stripe_currency,
'stripe_exchange_rate' => $this->stripe_exchange_rate,
'stripe_fee_amount' => $this->stripe_fee_amount,
'stripe_total_amount' => $this->stripe_total_amount,
'stripe_net_amount' => $this->stripe_net_amount,
'is_discount_applicable' => $this->is_discount_applicable,
'discount_total' => $this->discount_total,
'promo_code' => $this->getPromoCode() != NULL ? $this->getPromoCode()->jsonSerialize() : NULL,
'is_stripe_balance_transaction_details_updated' => $this->is_stripe_balance_transaction_details_updated,
'invoice' => $this->invoice,
);
}
/**
* @var string $created
*
* @ORM\Column(name="created_at", type="string", nullable=false)
*/
protected $createdAt;
/**
* @var string $updated
*
* @ORM\Column(name="updated_at", type="string", nullable=false)
*/
protected $updatedAt;
public function getCreatedAt()
{
return $this->createdAt;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps()
{
$this->setUpdatedAt(round(microtime(true) * 1000));
if ($this->getCreatedAt() === null) {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}
public function __construct() {
$this->orders_custom_pricing = new ArrayCollection();
$this->orders_special_pricing = new ArrayCollection();
$this->setCreatedAt(round(microtime(true) * 1000));
}
}