<?php
namespace Diplix\KMGBundle\Entity;
use Diplix\KMGBundle\Entity\Accounting\CoopMember;
use Diplix\KMGBundle\Entity\Accounting\Job;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\PropertyAccess\PropertyAccess;
/**
* @ORM\Table(name="orders", indexes={@ORM\Index(name="be_deleted",columns={"be_deleted"})})
* @ORM\Entity(repositoryClass="Diplix\KMGBundle\Repository\OrderRepository")
*/
class Order extends BasicEntity
{
const CM_SIGNATURE = 10;
const CM_PIN = 11;
const DIRECTION_DEFAULT = 0;
const DIRECTION_FORTH = 1;
const DIRECTION_BACK = 2;
const DIRECTION_TWOWAY = 3;
const DIRECTION_TWOWAY_REVERSE = 4;
const TIME_LAG_HOURS = 4;
const REMOTE_PENDING = 0;
const REMOTE_ERROR = 1;
const REMOTE_SUCCESS = 10;
const INSTANT_ORDER_REQUEST_PENDING = 100;
const INSTANT_ORDER_ACCEPTED = 101;
const INSTANT_ORDER_DECLINED = 102;
const INSTANT_ORDER_TIMEOUT = 103;
public static $remoteStatusMap = [
self::REMOTE_PENDING => 'Wartet',
self::REMOTE_ERROR => 'Fehler',
self::REMOTE_SUCCESS => 'Erfolgreich'
];
const CARTYPE_PKW = "PKW";
const CARTYPE_MINIVAN = "Minivan";
const CARTYPE_BUS = "Reisebus";
const CARTYPE_KOMBI ="Kombi";
public static $carTypes = array(self::CARTYPE_PKW=>self::CARTYPE_PKW,
self::CARTYPE_MINIVAN=>self::CARTYPE_MINIVAN,
self::CARTYPE_BUS => self::CARTYPE_BUS,
self::CARTYPE_KOMBI => self::CARTYPE_KOMBI);
public static $carPersonsMax = array( self::CARTYPE_PKW => 4,
self::CARTYPE_KOMBI => 4,
self::CARTYPE_MINIVAN =>7,
self::CARTYPE_BUS=>54);
const AS_NONE = 0;
const AS_LAST_ASSIGNMENT_DENIED = 1;
/**
* @ORM\Column(type="integer",name="id")
* @ORM\Id()
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string")
*/
protected $orderId = "";
/**
* @ORM\Column(type="string",nullable=true, unique=false)
*/
protected $viewSecret;
/**
* @ORM\Column(type="string")
*/
protected $originOrderId = "";
/**
* @ORM\ManyToOne(targetEntity="Customer")
* @ORM\JoinColumn(name="customer_id",nullable=false)
*/
protected $customer;
/**
* @ORM\Column(type="datetime",nullable=false)
*/
protected $orderTime;
/**
* @ORM\ManyToOne(targetEntity="OrderStatus")
* @ORM\JoinColumn(name="order_status_id",nullable=false)
*/
protected $orderStatus;
/**
* @ORM\Column(type="integer")
*/
protected $personCount;
/**
* @ORM\Column(type="integer")
*/
protected $personAsChildrenCount = 0;
/**
* @ORM\Column(type="string")
*/
protected $ccEmail = "";
/**
* @ORM\ManyToOne(targetEntity="PaymentType")
* @ORM\JoinColumn(name="payment_type_id",nullable=false)
*/
protected $paymentType;
/**
* @ORM\Column(type="string")
*/
protected $costCenter = "";
/**
* @ORM\Column(type="text")
*/
protected $comment = "";
/**
* @ORM\Column(type="string")
*/
protected $internalComment = "";
/**
* @ORM\Column(type="string")
*/
protected $ordererName = "";
/**
* @ORM\Column(type="string")
*/
protected $ordererForename = "";
/**
* @ORM\Column(type="string")
*/
protected $ordererPhone = "";
/**
* @ORM\Column(type="string")
*/
protected $ordererMail = "";
/**
* @ORM\OneToMany(targetEntity="Address", mappedBy="owningOrder", cascade={"persist"})
* @ORM\JoinColumn(referencedColumnName="id",nullable=true)
* @ORM\OrderBy({"sortOrder" = "ASC"})
*/
protected $addressList = null;
/**
* @ORM\Column(type="string")
*/
protected $remoteOrderId = "";
/**
* @ORM\Column(type="integer")
*/
protected $remoteStatus = self::REMOTE_PENDING;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
protected $remoteOrderSubmittedTime = null;
/**
* @ORM\Column(type="integer")
*/
protected $remoteResult = 0;
/**
* @ORM\Column(type="string")
*/
protected $remoteResultText = "";
/**
* @ORM\Column(type="integer")
*/
protected $childSeatCount = 0;
/**
* @ORM\Column(type="string")
*/
protected $flightNo = "";
/**
* @ORM\Column(type="time", nullable=true)
*
*/
protected $flightTime = null;
/**
* @ORM\Column(type="string")
*/
protected $childSeatInfo = "";
/**
* @ORM\Column(type="string")
*/
protected $carType = "";
/**
* @ORM\Column(type="integer")
*/
protected $carTypeSize = 0;
/**
* @ORM\Column(type="string")
*/
protected $creditCardNo = "";
/**
* @ORM\Column(type="string")
*/
protected $creditCardMonth = "";
/**
* @ORM\Column(type="string")
*/
protected $creditCardYear = "";
/**
* @ORM\Column(type="integer")
*/
protected $lastEstimatedDistance = 0;
/**
* @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":false})
*/
protected $lastEstimatedPrice = 0.0;
/**
* @ORM\Column(type="integer")
*/
protected $lastPriceListId = 0;
/**
* @ORM\ManyToOne (targetEntity="Diplix\KMGBundle\Entity\PriceList")
* @ORM\JoinColumn (nullable=true)
*/
protected $priceList;
/**
* @ORM\Column(type="decimal", nullable=true, precision=12, scale=2,options={"unsigned":false})
*/
protected $fixedPrice = null;
/**
* @ORM\Column(type="boolean")
*/
protected $isVip = false;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $region = null;
/**
* @ORM\Column(type="string",nullable=true)
*/
protected $destination = null;
/**
* @ORM\Column(type="boolean")
*/
protected $isFamily = false;
/**
* @ORM\Column(type="integer")
*/
protected $familyKidAddOn = 0;
/**
* @ORM\Column(type="integer")
*/
protected $familyAdultAddOn = 0;
/**
* @ORM\Column(type="integer")
*/
protected $direction = self::DIRECTION_DEFAULT;
/**
* @ORM\Column(type="integer")
*/
protected $extraApproaches = 0;
/**
* @ORM\Column(type="integer")
*/
protected $extraLuggage = 0;
/**
* @ORM\Column(type="integer")
*/
protected $extraBicycles = 0;
/**
* @ORM\OneToMany(targetEntity="Diplix\KMGBundle\Entity\Order", mappedBy="referencedParentOrder")
*/
private $childOrders;
/**
* @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Order", fetch="EAGER", inversedBy="childOrders")
* @ORM\OrderBy({"id" = "DESC"})
*/
protected $referencedParentOrder = null;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
protected $returnOrderTime;
/**
* @ORM\Column(type="string")
*/
protected $returnFlightNo = "";
/**
* @ORM\Column(type="boolean")
*/
protected $alreadyPaid = false;
/**
* @ORM\OneToMany(targetEntity="Diplix\KMGBundle\Entity\Payment", fetch="EAGER", mappedBy="order")
* @var Collection<Payment>
*/
protected Collection $paymentReference;
/**
* @ORM\Column(type="string")
*/
protected $confirmationPin = '';
/**
* @ORM\Column(type="integer")
*/
protected $preferredConfirmationMethod = self::CM_SIGNATURE;
/**
* @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\CoopMember")
* @ORM\JoinColumn(name="assigned_to_id",nullable=true)
*/
protected $assignedTo = null;
/**
* @ORM\Column(type="boolean")
*/
protected $assignmentConfirmed = false;
/**
* @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\User")
* @ORM\JoinColumn(nullable=true)
*/
protected ?User $assignmentUser = null;
/**
* @ORM\Column(type="integer")
*/
protected $assignmentStatus = self::AS_NONE;
/**
* @ORM\Column(type="datetime")
* @ORM\Version
*/
protected $version;
/**
* @ORM\OneToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\Job", mappedBy="knownOrder", cascade={"persist"} )
* @ORM\JoinColumn(nullable=true)
*/
protected $job;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
protected $instantOrderInitiated;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
protected $instantOrderResponded;
/**
* @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\User")
* @ORM\JoinColumn(nullable=true)
*/
protected $instantOrderRespondedBy;
/**
* @ORM\Column(type="text",nullable=true)
*/
protected $instantOrderComment;
/**
* @ORM\Column(type="integer")
*/
protected $instantOrderStatus = 0;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
protected $orderInitiatedOn;
/**
* @ORM\Column(type="datetime",nullable=true)
*/
protected $jobPdfRequestedOn;
/**
* @ORM\Column(type="boolean")
*/
protected $blumTransferOnly = false;
public static $generatorMap = array(
"1","2","3","4","5","6","7","8","9"
);
const XCHG_NONE = 0;
const XCHG_SENT_TO_OTHER = 10;
const XCHG_RECEIVED_FROM_OTHER = 20;
/**
* @ORM\Column(type="integer")
*/
protected $xchgStatus = self::XCHG_NONE;
/**
* @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\CoopMember")
* @ORM\JoinColumn(name="xchg_to_id",nullable=true)
*/
protected $xchgTo;
/**
* @ORM\Column(type="string")
*/
protected $xchgOrderId = '';
/**
* @ORM\Column(type="integer")
*/
protected $xchgOrderStatus = 0; // vgl. orderStatus
/**
* @ORM\Column(type="integer")
*/
protected $xchgConfirmed = false;
/**
* @ORM\Column(type="integer", options={"default":0})
*/
protected $customerNotificationState = 0;
const CNS_INITIAL_SMS = 0x01;
/**
* @ORM\Column(type="decimal", nullable=true, precision=5, scale=2,options={"unsigned":false})
*/
protected $discount = 0.0;
public static function generatePin($len=6)
{
$pin = '';
$max = count(self::$generatorMap)-1;
for ($i=0; $i < $len; $i++)
{
$r = random_int(0,$max);
$pin .= self::$generatorMap[$r];
}
return $pin;
}
public function __toString()
{
return sprintf("Order#%d %s",$this->getId(),$this->getOrderId());
}
public function __construct()
{
$this->addressList = new ArrayCollection();
$this->paymentReference = new ArrayCollection();
$this->childOrders = new ArrayCollection();
$this->confirmationPin = self::generatePin();
$this->viewSecret = self::generatePin(8);
}
public function __clone()
{
$this->id = null;
$this->orderId = '';
$this->remoteOrderId = '';
$this->confirmationPin = self::generatePin();
$this->remoteOrderSubmittedTime = null;
$this->remoteStatus = self::REMOTE_PENDING;
$this->orderStatus = null;
$oldList = $this->addressList;
$this->addressList = new ArrayCollection();
foreach ($oldList->toArray() as $elem)
{
$this->addAddress(clone $elem);
}
$this->returnFlightNo= '';
$this->returnOrderTime=null;
$this->referencedParentOrder = null;
$this->alreadyPaid = false;
$this->lastEstimatedDistance = 0;
$this->lastEstimatedPrice = 0;
$this->assignedTo = null;
$this->assignmentConfirmed = false;
$this->assignmentUser = null;
$this->customerNotificationState = 0;
$this->job = null;
$this->instantOrderStatus = 0;
$this->instantOrderComment = null;
$this->instantOrderInitiated = null;
$this->instantOrderRespondedBy = null;
$this->instantOrderResponded = null;
$this->jobPdfRequestedOn = null;
$this->xchgStatus = self::XCHG_NONE;
$this->xchgOrderStatus = 0;
$this->xchgTo = null;
$this->xchgOrderId = '';
$this->xchgConfirmed = false;
// remove relations
$this->paymentReference = new ArrayCollection();
$this->childOrders = new ArrayCollection();
}
public function isDraft(): bool
{
// new 2020 behavior
if ($this->getOrderStatus()->getId()===OrderStatus::STATUS_DRAFT)
{
return true;
}
// backward compatibility
/** @noinspection TypeUnsafeComparisonInspection */
return ($this->remoteStatus == self::REMOTE_PENDING);
}
/**
* @param Order $parent
* @param Order|mixed $child
* @return Order
*/
public static function createOrUpdateChildOrder(Order $parent, $child)
{
if (!is_object($child))
{
$child = clone($parent);
$child->setReferencedParentOrder($parent);
}
else
{
// copy all addresses from parent order (to reflect changes)
foreach ($child->getAddressList() as $a) $a->setBeDeleted(true);
foreach ($parent->getAddressList() as $a)
{
$child->addAddress(clone $a);
}
}
// setup addresses in reverse order
$addresses = $child->getAddressList()->toArray();
/** @var Address $a */
$sort = count($addresses);
foreach ($addresses as $a)
{
$a->setSortOrder($sort--);
}
// copy other fields
$pa = PropertyAccess::createPropertyAccessor();
foreach([ 'personCount',
'personAsChildrenCount',
'ccEmail',
'carType',
'paymentType',
'costCenter',
'comment',
'internalComment',
'ordererName',
'ordererForename',
'ordererPhone',
'ordererMail',
'childSeatCount',
'childSeatInfo',
'creditCardNo',
'creditCardMonth',
'creditCardYear',
'isVip',
'extraApproaches',
'extraLuggage',
'extraBicycles'] as $k)
{
$pa->setValue($child,$k, $pa->getValue($parent,$k) );
}
// set fields from return fields
$child->setOrderTime($parent->getReturnOrderTime());
$child->setFlightNo($parent->getReturnFlightNo());
$child->setLastEstimatedPrice(0);
$child->setLastEstimatedDistance($parent->getLastEstimatedDistance());
// all done
return $child;
}
public function getFinalPrice()
{
if ($this->getFixedPrice()!==null)
return $this->getFixedPrice();
else
return $this->getLastEstimatedPrice();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return Customer
*/
public function getCustomer()
{
return $this->customer;
}
/**
* @param mixed $customer
*/
public function setCustomer($customer)
{
$this->customer = $customer;
}
/**
* @return \DateTime
*/
public function getOrderTime()
{
return $this->orderTime;
}
/**
* @param mixed $orderTime
*/
public function setOrderTime($orderTime)
{
$this->orderTime = $orderTime;
}
/**
* @return OrderStatus
*/
public function getOrderStatus()
{
return $this->orderStatus;
}
/**
* @param mixed $orderStatus
*/
public function setOrderStatus($orderStatus)
{
$this->orderStatus = $orderStatus;
}
/**
* @return mixed
*/
public function getPersonCount()
{
return $this->personCount;
}
/**
* @param mixed $personCount
*/
public function setPersonCount($personCount)
{
$this->personCount = $personCount;
}
/**
* @return PaymentType
*/
public function getPaymentType()
{
return $this->paymentType;
}
/**
* @param mixed $paymentType
*/
public function setPaymentType($paymentType)
{
$this->paymentType = $paymentType;
}
/**
* @return mixed
*/
public function getCostCenter()
{
return $this->costCenter;
}
/**
* @param mixed $costCenter
*/
public function setCostCenter($costCenter)
{
$this->costCenter = $costCenter;
}
/**
* @return mixed
*/
public function getComment()
{
return $this->comment;
}
/**
* @param mixed $comment
*/
public function setComment($comment)
{
$this->comment = $comment;
}
/**
* @return mixed
*/
public function getOrdererName()
{
return $this->ordererName;
}
/**
* @param mixed $ordererName
*/
public function setOrdererName($ordererName)
{
$this->ordererName = $ordererName;
}
/**
* @return mixed
*/
public function getOrdererForename()
{
return $this->ordererForename;
}
/**
* @param mixed $ordererForename
*/
public function setOrdererForename($ordererForename)
{
$this->ordererForename = $ordererForename;
}
/**
* @return mixed
*/
public function getOrdererPhone()
{
return $this->ordererPhone;
}
/**
* @param mixed $ordererPhone
*/
public function setOrdererPhone($ordererPhone)
{
$this->ordererPhone = $ordererPhone;
}
/**
* @return mixed
*/
public function getOrdererMail()
{
return $this->ordererMail;
}
/**
* @param mixed $ordererMail
*/
public function setOrdererMail($ordererMail)
{
$this->ordererMail = $ordererMail;
}
public function addAddressList(Address $a) { return $this->addAddress($a); } // for reflection usage
public function addAddress(Address $a)
{
$a->setOwningOrder($this);
$this->addressList->add($a);
}
public function removeAddressList(Address $a) { return $this->removeAddress($a); } // for reflection usage
public function removeAddress(Address $a)
{
$this->addressList->removeElement($a);
}
public function clearAddressList()
{
$this->addressList->clear();
}
public function getAddressList()
{
$al = $this->addressList;
// if the list is not loaded from the database, the order may be incorrect -> sort it
$iterator = $al->getIterator();
$iterator->uasort(function ($a, $b) {
return ($a->getSortOrder() < $b->getSortOrder()) ? -1 : 1;
});
$res = new ArrayCollection(iterator_to_array($iterator));
/*// cls: debug
$i=0;
foreach ($res as $a)
{
echo ($i++)." : ".$a->getId()." : ".$a->getSortOrder()." || ";
}*/
return $res;
}
public function removeDeletedAddressesFromList()
{
$adr = $this->addressList->toArray();
$this->addressList = new ArrayCollection(array_filter($adr, function(Address $a) {
return !$a->getBeDeleted();
}));
}
public function reorganizeSortOrder()
{
// an sortOrder of < 0 may cause strange behaviour for which it is not that easy to find the problem source
// just assign new sortorders > 0. getAddressList() already returns the list in the right order
$al = $this->getAddressList();
$sort = 0;
foreach ($al as $a) $a->setSortOrder($sort++);
}
/**
* @return mixed
*/
public function getRemoteStatus()
{
return $this->remoteStatus;
}
/**
* @param mixed $remoteStatus
*/
public function setRemoteStatus($remoteStatus)
{
$this->remoteStatus = $remoteStatus;
}
/**
* @return mixed
*/
public function getRemoteResult()
{
return $this->remoteResult;
}
/**
* @param mixed $remoteResult
*/
public function setRemoteResult($remoteResult)
{
$this->remoteResult = $remoteResult;
}
/**
* @return string
*/
public function getRemoteOrderId(): string
{
return $this->remoteOrderId;
}
/**
* @param string $remoteOrderId
*/
public function setRemoteOrderId(string $remoteOrderId): void
{
$this->remoteOrderId = $remoteOrderId;
}
/**
* @return mixed
*/
public function getOrderId()
{
return $this->orderId;
}
/**
* @param mixed $orderId
*/
public function setOrderId($orderId)
{
$this->orderId = $orderId;
}
/**
* @return mixed
*/
public function getRemoteResultText()
{
return $this->remoteResultText;
}
/**
* @param mixed $remoteResultText
*/
public function setRemoteResultText($remoteResultText)
{
$this->remoteResultText = $remoteResultText;
}
/**
* @return mixed
*/
public function getCcEmail()
{
return $this->ccEmail;
}
/**
* @param mixed $ccEmail
*/
public function setCcEmail($ccEmail)
{
$this->ccEmail = $ccEmail;
}
/**
* @return mixed
*/
public function getChildSeatCount()
{
return $this->childSeatCount;
}
/**
* @param mixed $childSeatCount
*/
public function setChildSeatCount($childSeatCount)
{
$this->childSeatCount = $childSeatCount;
}
/**
* @return mixed
*/
public function getFlightNo()
{
return $this->flightNo;
}
/**
* @param mixed $flightNo
*/
public function setFlightNo($flightNo)
{
$this->flightNo = $flightNo;
}
/**
* @return mixed
*/
public function getChildSeatInfo()
{
return $this->childSeatInfo;
}
/**
* @param mixed $childSeatInfo
*/
public function setChildSeatInfo($childSeatInfo)
{
$this->childSeatInfo = $childSeatInfo;
}
/**
* @return mixed
*/
public function getCarType()
{
return $this->carType;
}
/**
* @param mixed $carType
*/
public function setCarType($carType)
{
$this->carType = $carType;
}
/**
* @return mixed
*/
public function getCarTypeSize()
{
return $this->carTypeSize;
}
/**
* @param mixed $carTypeSize
*/
public function setCarTypeSize($carTypeSize)
{
$this->carTypeSize = $carTypeSize;
}
/**
* @return mixed
*/
public function getCreditCardNo()
{
return $this->creditCardNo;
}
/**
* @param mixed $creditCardNo
*/
public function setCreditCardNo($creditCardNo)
{
$this->creditCardNo = $creditCardNo;
}
/**
* @return mixed
*/
public function getCreditCardMonth()
{
return $this->creditCardMonth;
}
/**
* @param mixed $creditCardMonth
*/
public function setCreditCardMonth($creditCardMonth)
{
$this->creditCardMonth = $creditCardMonth;
}
/**
* @return mixed
*/
public function getCreditCardYear()
{
return $this->creditCardYear;
}
/**
* @param mixed $creditCardYear
*/
public function setCreditCardYear($creditCardYear)
{
$this->creditCardYear = $creditCardYear;
}
/**
* @return mixed
*/
public function getLastEstimatedDistance()
{
return $this->lastEstimatedDistance;
}
/**
* @param mixed $lastEstimatedDistance
*/
public function setLastEstimatedDistance($lastEstimatedDistance)
{
$this->lastEstimatedDistance = (int)$lastEstimatedDistance;
}
/**
* @return mixed
*/
public function getLastEstimatedPrice()
{
return $this->lastEstimatedPrice;
}
/**
* @param mixed $lastEstimatedPrice
*/
public function setLastEstimatedPrice($lastEstimatedPrice)
{
$this->lastEstimatedPrice = $lastEstimatedPrice;
}
/**
* @return \DateTime|null
*/
public function getRemoteOrderSubmittedTime()
{
return $this->remoteOrderSubmittedTime;
}
/**
* @param mixed $remoteOrderSubmittedTime
*/
public function setRemoteOrderSubmittedTime($remoteOrderSubmittedTime)
{
$this->remoteOrderSubmittedTime = $remoteOrderSubmittedTime;
}
// /**
// * @return mixed
// * @deprecated
// */
// public function getLastPriceListId()
// {
// return $this->lastPriceListId;
// }
//
// /**
// * @param mixed $lastPriceListId
// * @deprecated
// */
// public function setLastPriceListId($lastPriceListId)
// {
// $this->lastPriceListId = $lastPriceListId;
// }
/**
* @return null|PriceList
*/
public function getPriceList()
{
return $this->priceList;
}
/**
* @param mixed $priceList
*/
public function setPriceList($priceList): void
{
$this->priceList = $priceList;
$this->lastPriceListId = ($priceList!==null?$priceList->getId():0);
}
/**
* @return mixed
*/
public function getIsVip()
{
return $this->isVip;
}
/**
* @param mixed $isVip
*/
public function setIsVip($isVip)
{
$this->isVip = $isVip;
}
/**
* @return mixed
*/
public function getFixedPrice()
{
return $this->fixedPrice;
}
/**
* @param mixed $fixedPrice
*/
public function setFixedPrice($fixedPrice)
{
$this->fixedPrice = $fixedPrice;
}
/**
* @return mixed
*/
public function getRegion()
{
return $this->region;
}
/**
* @param mixed $region
*/
public function setRegion($region)
{
$this->region = $region;
}
/**
* @return mixed
*/
public function getisFamily()
{
return $this->isFamily;
}
/**
* @param mixed $isFamily
*/
public function setIsFamily($isFamily)
{
$this->isFamily = $isFamily;
}
/**
* @return mixed
*/
public function getFamilyKidAddOn()
{
return $this->familyKidAddOn;
}
/**
* @param mixed $familyKidAddOn
*/
public function setFamilyKidAddOn($familyKidAddOn)
{
$this->familyKidAddOn = $familyKidAddOn;
}
/**
* @return mixed
*/
public function getDestination()
{
return $this->destination;
}
/**
* @param mixed $destination
*/
public function setDestination($destination)
{
$this->destination = $destination;
}
/**
* @return mixed
*/
public function getDirection()
{
return $this->direction;
}
/**
* @param mixed $direction
*/
public function setDirection($direction)
{
$this->direction = $direction;
}
/**
* @return Order|null
*/
public function getReferencedParentOrder()
{
return $this->referencedParentOrder;
}
/**
* @param Order|null $referencedParentOrder
*/
public function setReferencedParentOrder($referencedParentOrder,$includeInverseSide=true)
{
$this->referencedParentOrder = $referencedParentOrder;
if ($includeInverseSide)
{
if ($referencedParentOrder!==null) $referencedParentOrder->setChildOrder($this);
}
}
/**
* @return mixed
*/
public function getExtraApproaches()
{
return $this->extraApproaches;
}
/**
* @param mixed $extraApproaches
*/
public function setExtraApproaches($extraApproaches)
{
$this->extraApproaches = $extraApproaches;
}
/**
* @return mixed
*/
public function getExtraLuggage()
{
return $this->extraLuggage;
}
/**
* @param mixed $extraLuggage
*/
public function setExtraLuggage($extraLuggage)
{
$this->extraLuggage = $extraLuggage;
}
/**
* @return mixed
*/
public function getExtraBicycles()
{
return $this->extraBicycles;
}
/**
* @param mixed $extraBicycles
*/
public function setExtraBicycles($extraBicycles)
{
$this->extraBicycles = $extraBicycles;
}
/**
* @return mixed
*/
public function getReturnOrderTime()
{
return $this->returnOrderTime;
}
/**
* @param mixed $returnOrderTime
*/
public function setReturnOrderTime($returnOrderTime)
{
$this->returnOrderTime = $returnOrderTime;
}
/**
* @return mixed
*/
public function getReturnFlightNo()
{
return $this->returnFlightNo;
}
/**
* @param mixed $returnFlightNo
*/
public function setReturnFlightNo($returnFlightNo)
{
$this->returnFlightNo = $returnFlightNo;
}
/**
* @return mixed
*/
public function getFlightTime()
{
return $this->flightTime;
}
/**
* @param mixed $flightTime
*/
public function setFlightTime($flightTime)
{
$this->flightTime = $flightTime;
}
/**
* @return mixed
*/
public function getFamilyAdultAddOn()
{
return $this->familyAdultAddOn;
}
/**
* @param mixed $familyAdultAddOn
*/
public function setFamilyAdultAddOn($familyAdultAddOn)
{
$this->familyAdultAddOn = $familyAdultAddOn;
}
/**
* @return mixed
*/
public function getPersonAsChildrenCount()
{
return $this->personAsChildrenCount;
}
/**
* @param mixed $personAsChildrenCount
*/
public function setPersonAsChildrenCount($personAsChildrenCount)
{
$this->personAsChildrenCount = $personAsChildrenCount;
}
/**
* @return mixed
*/
public function getAlreadyPaid()
{
return $this->alreadyPaid;
}
/**
* @param mixed $alreadyPaid
*/
public function setAlreadyPaid($alreadyPaid)
{
$this->alreadyPaid = $alreadyPaid;
}
/**
* @return Payment[]|ArrayCollection
*/
public function getPaymentReference()
{
return $this->paymentReference;
}
/**
* @param mixed $paymentReference
*/
public function setPaymentReference($paymentReference)
{
$this->paymentReference = $paymentReference;
}
/**
* @return string
*/
public function getConfirmationPin(): string
{
return $this->confirmationPin;
}
/**
* @param string $confirmationPin
*/
public function setConfirmationPin(string $confirmationPin): void
{
$this->confirmationPin = $confirmationPin;
}
/**
* @return null|CoopMember
*/
public function getAssignedTo()
{
return $this->assignedTo;
}
/**
* @param null|CoopMember $assignedTo
*/
public function setAssignedTo($assignedTo): void
{
if ($assignedTo===null)
{
$this->setJobPdfRequestedOn(null);
}
else
if ( ($this->assignedTo!==null) && ($assignedTo->getId() !== $this->assignedTo->getId()) )
{
$this->setJobPdfRequestedOn(null);
}
$this->assignedTo = $assignedTo;
}
/**
* @return mixed
*/
public function getVersion()
{
return $this->version;
}
/**
* @param mixed $version
*/
public function setVersion($version): void
{
$this->version = $version;
}
/**
* @return bool
*/
public function isAssignmentConfirmed(): bool
{
return $this->assignmentConfirmed;
}
/**
* @param bool $assignmentConfirmed
*/
public function setAssignmentConfirmed(bool $assignmentConfirmed, ?User $assignedUser = null): void
{
$this->assignmentConfirmed = $assignmentConfirmed;
if ($assignmentConfirmed)
{
$this->assignmentUser = $assignedUser;
}
else
{
$this->assignmentUser = null;
}
}
/**
* @return int
*/
public function getPreferredConfirmationMethod(): int
{
return $this->preferredConfirmationMethod;
}
/**
* @param int $preferredConfirmationMethod
*/
public function setPreferredConfirmationMethod(int $preferredConfirmationMethod): void
{
$this->preferredConfirmationMethod = $preferredConfirmationMethod;
}
/**
* @return null|Job
*/
public function getJob()
{
return $this->job;
}
/**
* @param mixed $job
*/
public function setJob($job): void
{
$this->job = $job;
}
/**
* @return mixed
*/
public function getInstantOrderInitiated()
{
return $this->instantOrderInitiated;
}
/**
* @param mixed $instantOrderInitiated
*/
public function setInstantOrderInitiated($instantOrderInitiated): void
{
$this->instantOrderInitiated = $instantOrderInitiated;
}
/**
* @return mixed
*/
public function getInstantOrderComment()
{
return $this->instantOrderComment;
}
/**
* @param mixed $instantOrderComment
*/
public function setInstantOrderComment($instantOrderComment): void
{
$this->instantOrderComment = $instantOrderComment;
}
/**
* @return mixed
*/
public function getInstantOrderResponded()
{
return $this->instantOrderResponded;
}
/**
* @param mixed $instantOrderResponded
*/
public function setInstantOrderResponded($instantOrderResponded): void
{
$this->instantOrderResponded = $instantOrderResponded;
}
/**
* @return mixed
*/
public function getInstantOrderRespondedBy()
{
return $this->instantOrderRespondedBy;
}
/**
* @param mixed $instantOrderRespondedBy
*/
public function setInstantOrderRespondedBy($instantOrderRespondedBy): void
{
$this->instantOrderRespondedBy = $instantOrderRespondedBy;
}
/**
* @return int
*/
public function getInstantOrderStatus(): int
{
return $this->instantOrderStatus;
}
/**
* @param int $instantOrderStatus
*/
public function setInstantOrderStatus(int $instantOrderStatus): void
{
$this->instantOrderStatus = $instantOrderStatus;
}
/**
* @return mixed
*/
public function getOrderInitiatedOn()
{
return $this->orderInitiatedOn;
}
/**
* @param mixed $orderInitiatedOn
*/
public function setOrderInitiatedOn($orderInitiatedOn): void
{
$this->orderInitiatedOn = $orderInitiatedOn;
}
public function setChildOrder(Order $child)
{
$exist = $this->getChildOrder();
if ($exist !== null)
{
if (($child!==null)&&($exist->getId() === $child->getId()))
{
return; // already set
}
$exist->setReferencedParentOrder(null,false);
$this->childOrders->clear();
}
if ($child !== null)
{
$this->childOrders->add($child);
$child->setReferencedParentOrder($this,false);
}
}
/**
* @return Order|null
*/
public function getChildOrder()
{
if ($this->childOrders->count()>1)
throw new \LogicException("Multiple child orders are not supported !");
if ($this->childOrders->count()===1)
return $this->childOrders->first();
return null;
}
/**
* @return string
*/
public function getInternalComment()
{
return $this->internalComment;
}
/**
* @param string $internalComment
*/
public function setInternalComment(string $internalComment)
{
$this->internalComment = $internalComment;
}
/**
* @return mixed
*/
public function getJobPdfRequestedOn()
{
return $this->jobPdfRequestedOn;
}
/**
* @param mixed $jobPdfRequestedOn
*/
public function setJobPdfRequestedOn($jobPdfRequestedOn): void
{
$this->jobPdfRequestedOn = $jobPdfRequestedOn;
}
/**
* @return int
*/
public function getAssignmentStatus(): int
{
return $this->assignmentStatus;
}
/**
* @param int $assignmentStatus
*/
public function setAssignmentStatus(int $assignmentStatus): void
{
$this->assignmentStatus = $assignmentStatus;
}
/**
* @return bool
*/
public function isBlumTransferOnly(): bool
{
return $this->blumTransferOnly;
}
/**
* @param bool $blumTransferOnly
*/
public function setBlumTransferOnly(bool $blumTransferOnly): void
{
$this->blumTransferOnly = $blumTransferOnly;
}
/**
* @return mixed
*/
public function getXchgStatus()
{
return $this->xchgStatus;
}
/**
* @param mixed $xchgStatus
*/
public function setXchgStatus($xchgStatus): void
{
$this->xchgStatus = $xchgStatus;
}
/**
* @return mixed
*/
public function getXchgOrderStatus()
{
return $this->xchgOrderStatus;
}
/**
* @param mixed $xchgOrderStatus
*/
public function setXchgOrderStatus($xchgOrderStatus): void
{
$this->xchgOrderStatus = $xchgOrderStatus;
}
/**
* @return CoopMember|null
*/
public function getXchgTo()
{
return $this->xchgTo;
}
/**
* @param mixed $xchgTo
*/
public function setXchgTo($xchgTo): void
{
$this->xchgTo = $xchgTo;
}
/**
* @return string
*/
public function getXchgOrderId(): string
{
return $this->xchgOrderId;
}
/**
* @param string $xchgOrderId
*/
public function setXchgOrderId(string $xchgOrderId): void
{
$this->xchgOrderId = $xchgOrderId;
}
/**
* @return bool
*/
public function isXchgConfirmed(): bool
{
return $this->xchgConfirmed;
}
/**
* @param bool $xchgConfirmed
*/
public function setXchgConfirmed(bool $xchgConfirmed): void
{
$this->xchgConfirmed = $xchgConfirmed;
}
/**
* @return string
*/
public function getOriginOrderId(): string
{
return $this->originOrderId;
}
/**
* @param string $originOrderId
*/
public function setOriginOrderId(string $originOrderId): void
{
$this->originOrderId = $originOrderId;
}
/**
* @return User|null
*/
public function getAssignmentUser(): ?User
{
return $this->assignmentUser;
}
/**
* @return int
*/
public function getCustomerNotificationState(): int
{
return $this->customerNotificationState;
}
/**
* @param int $customerNotificationState
*/
public function setCustomerNotificationState(int $customerNotificationState): void
{
$this->customerNotificationState = $customerNotificationState;
}
/**
* @return string
*/
public function getViewSecret(): string
{
return $this->viewSecret;
}
/**
* @param string $viewSecret
*/
public function setViewSecret(string $viewSecret): void
{
$this->viewSecret = $viewSecret;
}
/**
* @return ?float
*/
public function getDiscount(): ?float
{
return $this->discount;
}
/**
* @param float $discount
*/
public function setDiscount(?float $discount): void
{
$this->discount = $discount;
}
}