<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\EntityRepo\OrderRepo")
* @ORM\Table(name="eshop_order")
*/
class Order
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $orderId=0;
/**
* @ORM\Column(type="integer")
*/
protected $eshopId=0;
/**
* @ORM\Column(type="integer")
*/
protected $contactId=0;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $status='new';
/**
* @ORM\Column(type="string", length=22)
*/
protected $ip;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $dateCreated;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $dateConfirmed;
/**
* @ORM\Column(type="integer")
*/
protected $paymentId=0;
/**
* @ORM\Column(type="integer")
*/
protected $deliveryId=0;
/**
* Many Orders have Many OrderItems.
* @ORM\ManyToMany(targetEntity="OrderItem")
* @ORM\JoinTable(name="order_orderitem",
* joinColumns={@ORM\JoinColumn(name="order_id", referencedColumnName="order_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="order_item_id", referencedColumnName="order_item_id", unique=false)}
* )
*/
protected $orderItems;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $eshopDeliveryId;
/**
* @ORM\ManyToOne(targetEntity="EshopDelivery")
* @ORM\JoinColumn(name="eshop_delivery_id", referencedColumnName="eshop_delivery_id")
*/
protected $eshopDelivery;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $eshopPaymentId;
/**
* @ORM\ManyToOne(targetEntity="EshopPayment",cascade={"persist"})
* @ORM\JoinColumn(name="eshop_payment_id", referencedColumnName="eshop_payment_id")
*/
protected $eshopPayment;
/**
* @ORM\Column(type="integer")
*/
protected $eshopContactId;
/**
* @ORM\ManyToOne(targetEntity="Contact")
* @ORM\JoinColumn(name="eshop_contact_id", referencedColumnName="contact_id")
*/
protected $eshopContact;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
protected $paymentStatus='';
/**
* @ORM\Column(type="string", length=3, nullable=true)
*/
protected $currencyKey='';
/**
* Get orderId
*
* @return integer
*/
public function getOrderId()
{
return $this->orderId;
}
/**
* Set eshopId
*
* @param integer $eshopId
*
* @return Order
*/
public function setEshopId($eshopId)
{
$this->eshopId = $eshopId;
return $this;
}
/**
* Get eshopId
*
* @return integer
*/
public function getEshopId()
{
return $this->eshopId;
}
/**
* Set contactId
*
* @param integer $contactId
*
* @return Order
*/
public function setContactId($contactId)
{
$this->contactId = $contactId;
return $this;
}
/**
* Get contactId
*
* @return integer
*/
public function getContactId()
{
return $this->contactId;
}
/**
* Set status
*
* @param string $status
*
* @return Order
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Get status
*
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Set ip
*
* @param string $ip
*
* @return Order
*/
public function setIp($ip)
{
$this->ip = $ip;
return $this;
}
/**
* Get ip
*
* @return string
*/
public function getIp()
{
return $this->ip;
}
/**
* Set dateCreated
*
* @param \DateTime $dateCreated
*
* @return Order
*/
public function setDateCreated($dateCreated)
{
$this->dateCreated = $dateCreated;
return $this;
}
/**
* Get dateCreated
*
* @return \DateTime
*/
public function getDateCreated()
{
return $this->dateCreated;
}
/**
* Set dateConfirmed
*
* @param \DateTime $dateConfirmed
*
* @return Order
*/
public function setDateConfirmed($dateConfirmed)
{
$this->dateConfirmed = $dateConfirmed;
return $this;
}
/**
* Get dateConfirmed
*
* @return \DateTime
*/
public function getDateConfirmed()
{
return $this->dateConfirmed;
}
/**
* Set paymentId
*
* @param integer $paymentId
*
* @return Order
*/
public function setPaymentId($paymentId)
{
$this->paymentId = $paymentId;
return $this;
}
/**
* Get paymentId
*
* @return integer
*/
public function getPaymentId()
{
return $this->paymentId;
}
/**
* Set deliveryId
*
* @param integer $deliveryId
*
* @return Order
*/
public function setDeliveryId($deliveryId)
{
$this->deliveryId = $deliveryId;
return $this;
}
/**
* Get deliveryId
*
* @return integer
*/
public function getDeliveryId()
{
return $this->deliveryId;
}
/**
* Constructor
*/
public function __construct()
{
$this->orderItems = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add orderItem
*
* @param \App\Entity\OrderItem $orderItem
*
* @return Order
*/
public function addOrderItem(\App\Entity\OrderItem $orderItem)
{
$this->orderItems[] = $orderItem;
return $this;
}
/**
* Remove orderItem
*
* @param \App\Entity\OrderItem $orderItem
*/
public function removeOrderItem(\App\Entity\OrderItem $orderItem)
{
$this->orderItems->removeElement($orderItem);
}
/**
* Get orderItems
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getOrderItems()
{
return $this->orderItems;
}
/**
* Set eshopDeliveryId
*
* @param integer $eshopDeliveryId
*
* @return Order
*/
public function setEshopDeliveryId($eshopDeliveryId)
{
$this->eshopDeliveryId = $eshopDeliveryId;
return $this;
}
/**
* Get eshopDeliveryId
*
* @return integer
*/
public function getEshopDeliveryId()
{
return $this->eshopDeliveryId;
}
/**
* Set eshopDelivery
*
* @param \App\Entity\EshopDelivery $eshopDelivery
*
* @return Order
*/
public function setEshopDelivery(\App\Entity\EshopDelivery $eshopDelivery = null)
{
$this->eshopDelivery = $eshopDelivery;
return $this;
}
/**
* Get eshopDelivery
*
* @return \App\Entity\EshopDelivery
*/
public function getEshopDelivery()
{
return $this->eshopDelivery;
}
/**
* Set eshopPaymentId
*
* @param integer $eshopPaymentId
*
* @return Order
*/
public function setEshopPaymentId($eshopPaymentId)
{
$this->eshopPaymentId = $eshopPaymentId;
return $this;
}
/**
* Get eshopPaymentId
*
* @return integer
*/
public function getEshopPaymentId()
{
return $this->eshopPaymentId;
}
/**
* Set eshopPayment
*
* @param \App\Entity\EshopPayment $eshopPayment
*
* @return Order
*/
public function setEshopPayment(\App\Entity\EshopPayment $eshopPayment = null)
{
$this->eshopPayment = $eshopPayment;
return $this;
}
/**
* Get eshopPayment
*
* @return \App\Entity\EshopPayment
*/
public function getEshopPayment()
{
return $this->eshopPayment;
}
/**
* Set eshopContactId
*
* @param integer $eshopContactId
*
* @return Order
*/
public function setEshopContactId($eshopContactId)
{
$this->eshopContactId = $eshopContactId;
return $this;
}
/**
* Get eshopContactId
*
* @return integer
*/
public function getEshopContactId()
{
return $this->eshopContactId;
}
/**
* Set eshopContact
*
* @param \App\Entity\Contact $eshopContact
*
* @return Order
*/
public function setEshopContact(\App\Entity\Contact $eshopContact = null)
{
$this->eshopContact = $eshopContact;
return $this;
}
/**
* Get eshopContact
*
* @return \App\Entity\Contact
*/
public function getEshopContact()
{
return $this->eshopContact;
}
/**
* Set paymentStatus
*
* @param string $paymentStatus
*
* @return Order
*/
public function setPaymentStatus($paymentStatus)
{
$this->paymentStatus = $paymentStatus;
return $this;
}
/**
* Get paymentStatus
*
* @return string
*/
public function getPaymentStatus()
{
return $this->paymentStatus;
}
/**
* Set currencyKey
*
* @param string $currencyKey
*
* @return Order
*/
public function setCurrencyKey($currencyKey)
{
$this->currencyKey = $currencyKey;
return $this;
}
/**
* Get currencyKey
*
* @return string
*/
public function getCurrencyKey()
{
return $this->currencyKey;
}
}