src/Diplix/KMGBundle/Entity/Order.php line 15

Open in your IDE?
  1. <?php
  2. namespace Diplix\KMGBundle\Entity;
  3. use Diplix\KMGBundle\Entity\Accounting\CoopMember;
  4. use Diplix\KMGBundle\Entity\Accounting\Job;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\PropertyAccess\PropertyAccess;
  9. /**
  10.  * @ORM\Table(name="orders", indexes={@ORM\Index(name="be_deleted",columns={"be_deleted"})})
  11.  * @ORM\Entity(repositoryClass="Diplix\KMGBundle\Repository\OrderRepository")
  12.  */
  13. class Order extends BasicEntity
  14. {
  15.     const CM_SIGNATURE 10;
  16.     const CM_PIN 11;
  17.     const DIRECTION_DEFAULT 0;
  18.     const DIRECTION_FORTH 1;
  19.     const DIRECTION_BACK 2;
  20.     const DIRECTION_TWOWAY 3;
  21.     const DIRECTION_TWOWAY_REVERSE 4;
  22.     const TIME_LAG_HOURS 4;
  23.     const REMOTE_PENDING 0;
  24.     const REMOTE_ERROR 1;
  25.     const REMOTE_SUCCESS 10;
  26.     const INSTANT_ORDER_REQUEST_PENDING 100;
  27.     const INSTANT_ORDER_ACCEPTED 101;
  28.     const INSTANT_ORDER_DECLINED 102;
  29.     const INSTANT_ORDER_TIMEOUT 103;
  30.     public static $remoteStatusMap = [
  31.         self::REMOTE_PENDING => 'Wartet',
  32.         self::REMOTE_ERROR => 'Fehler',
  33.         self::REMOTE_SUCCESS => 'Erfolgreich'
  34.     ];
  35.     const CARTYPE_PKW "PKW";
  36.     const CARTYPE_MINIVAN "Minivan";
  37.     const CARTYPE_BUS "Reisebus";
  38.     const CARTYPE_KOMBI ="Kombi";
  39.     public static $carTypes = array(self::CARTYPE_PKW=>self::CARTYPE_PKW,
  40.                                     self::CARTYPE_MINIVAN=>self::CARTYPE_MINIVAN,
  41.                                     self::CARTYPE_BUS => self::CARTYPE_BUS,
  42.                                     self::CARTYPE_KOMBI => self::CARTYPE_KOMBI);
  43.     public static $carPersonsMax = array(   self::CARTYPE_PKW => 4,
  44.                                             self::CARTYPE_KOMBI => 4,
  45.                                             self::CARTYPE_MINIVAN =>7,
  46.                                             self::CARTYPE_BUS=>54);
  47.     const AS_NONE 0;
  48.     const AS_LAST_ASSIGNMENT_DENIED 1;
  49.     /**
  50.      * @ORM\Column(type="integer",name="id")
  51.      * @ORM\Id()
  52.      * @ORM\GeneratedValue(strategy="AUTO")
  53.      */
  54.     protected $id;
  55.      /**
  56.      * @ORM\Column(type="string")
  57.      */
  58.     protected $orderId "";
  59.     /**
  60.      * @ORM\Column(type="string",nullable=true, unique=false)
  61.      */
  62.     protected $viewSecret;
  63.     /**
  64.      * @ORM\Column(type="string")
  65.      */
  66.     protected $originOrderId "";
  67.     /**
  68.      * @ORM\ManyToOne(targetEntity="Customer")
  69.      * @ORM\JoinColumn(name="customer_id",nullable=false)
  70.      */
  71.     protected $customer;
  72.     /**
  73.      * @ORM\Column(type="datetime",nullable=false)
  74.      */
  75.     protected $orderTime;
  76.     /**
  77.      * @ORM\ManyToOne(targetEntity="OrderStatus")
  78.      * @ORM\JoinColumn(name="order_status_id",nullable=false)
  79.      */
  80.     protected $orderStatus;
  81.     /**
  82.      * @ORM\Column(type="integer")
  83.      */
  84.     protected $personCount;
  85.     /**
  86.      * @ORM\Column(type="integer")
  87.      */
  88.     protected $personAsChildrenCount 0;
  89.     /**
  90.      * @ORM\Column(type="string")
  91.      */
  92.     protected $ccEmail "";
  93.     /**
  94.      * @ORM\ManyToOne(targetEntity="PaymentType")
  95.      * @ORM\JoinColumn(name="payment_type_id",nullable=false)
  96.      */
  97.     protected $paymentType;
  98.     /**
  99.      * @ORM\Column(type="string")
  100.      */
  101.     protected $costCenter "";
  102.     /**
  103.      * @ORM\Column(type="text")
  104.      */
  105.     protected $comment "";
  106.     /**
  107.      * @ORM\Column(type="string")
  108.      */
  109.     protected $internalComment "";
  110.     /**
  111.      * @ORM\Column(type="string")
  112.      */
  113.     protected $ordererName "";
  114.     /**
  115.      * @ORM\Column(type="string")
  116.      */
  117.     protected $ordererForename "";
  118.     /**
  119.      * @ORM\Column(type="string")
  120.      */
  121.     protected $ordererPhone "";
  122.     /**
  123.      * @ORM\Column(type="string")
  124.      */
  125.     protected $ordererMail "";
  126.     /**
  127.      * @ORM\OneToMany(targetEntity="Address", mappedBy="owningOrder", cascade={"persist"})
  128.      * @ORM\JoinColumn(referencedColumnName="id",nullable=true)
  129.      * @ORM\OrderBy({"sortOrder" = "ASC"})
  130.      */
  131.     protected $addressList null;
  132.     /**
  133.      * @ORM\Column(type="string")
  134.      */
  135.     protected $remoteOrderId "";
  136.     /**
  137.      * @ORM\Column(type="integer")
  138.      */
  139.     protected $remoteStatus self::REMOTE_PENDING;
  140.     /**
  141.      * @ORM\Column(type="datetime",nullable=true)
  142.      */
  143.     protected $remoteOrderSubmittedTime null;
  144.     /**
  145.      * @ORM\Column(type="integer")
  146.      */
  147.     protected $remoteResult 0;
  148.     /**
  149.      * @ORM\Column(type="string")
  150.      */
  151.     protected $remoteResultText "";
  152.     /**
  153.      * @ORM\Column(type="integer")
  154.      */
  155.     protected $childSeatCount 0;
  156.     /**
  157.      * @ORM\Column(type="string")
  158.      */
  159.     protected $flightNo "";
  160.     /**
  161.      * @ORM\Column(type="time", nullable=true)
  162.      *
  163.      */
  164.     protected $flightTime null;
  165.     /**
  166.      * @ORM\Column(type="string")
  167.      */
  168.     protected $childSeatInfo "";
  169.     /**
  170.      * @ORM\Column(type="string")
  171.      */
  172.     protected $carType "";
  173.     /**
  174.      * @ORM\Column(type="integer")
  175.      */
  176.     protected $carTypeSize 0;
  177.     /**
  178.      * @ORM\Column(type="string")
  179.      */
  180.     protected $creditCardNo "";
  181.     /**
  182.      * @ORM\Column(type="string")
  183.      */
  184.     protected $creditCardMonth "";
  185.         /**
  186.      * @ORM\Column(type="string")
  187.      */
  188.     protected $creditCardYear "";
  189.     /**
  190.      * @ORM\Column(type="integer")
  191.      */
  192.     protected $lastEstimatedDistance 0;
  193.     /**
  194.      * @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":false})
  195.      */
  196.     protected $lastEstimatedPrice 0.0;
  197.     /**
  198.      * @ORM\Column(type="integer")
  199.      */
  200.     protected $lastPriceListId 0;
  201.     /**
  202.      * @ORM\ManyToOne (targetEntity="Diplix\KMGBundle\Entity\PriceList")
  203.      * @ORM\JoinColumn (nullable=true)
  204.      */
  205.     protected $priceList;
  206.     /**
  207.      * @ORM\Column(type="decimal", nullable=true, precision=12, scale=2,options={"unsigned":false})
  208.      */
  209.     protected $fixedPrice null;
  210.     /**
  211.      * @ORM\Column(type="boolean")
  212.      */
  213.     protected $isVip false;
  214.     /**
  215.      * @ORM\Column(type="string", nullable=true)
  216.      */
  217.     protected $region null;
  218.     /**
  219.      * @ORM\Column(type="string",nullable=true)
  220.      */
  221.     protected $destination null;
  222.     /**
  223.      * @ORM\Column(type="boolean")
  224.      */
  225.     protected $isFamily false;
  226.     /**
  227.      * @ORM\Column(type="integer")
  228.      */
  229.     protected $familyKidAddOn 0;
  230.     /**
  231.      * @ORM\Column(type="integer")
  232.      */
  233.     protected $familyAdultAddOn 0;
  234.     /**
  235.      * @ORM\Column(type="integer")
  236.      */
  237.     protected $direction self::DIRECTION_DEFAULT;
  238.     /**
  239.      * @ORM\Column(type="integer")
  240.      */
  241.     protected $extraApproaches 0;
  242.     /**
  243.      * @ORM\Column(type="integer")
  244.      */
  245.     protected $extraLuggage 0;
  246.     /**
  247.      * @ORM\Column(type="integer")
  248.      */
  249.     protected $extraBicycles 0;
  250.     /**
  251.      * @ORM\OneToMany(targetEntity="Diplix\KMGBundle\Entity\Order", mappedBy="referencedParentOrder")
  252.      */
  253.     private $childOrders;
  254.     /**
  255.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Order", fetch="EAGER", inversedBy="childOrders")
  256.      * @ORM\OrderBy({"id" = "DESC"})
  257.      */
  258.     protected $referencedParentOrder null;
  259.     /**
  260.      * @ORM\Column(type="datetime",nullable=true)
  261.      */
  262.     protected $returnOrderTime;
  263.     /**
  264.      * @ORM\Column(type="string")
  265.      */
  266.     protected $returnFlightNo "";
  267.     /**
  268.      * @ORM\Column(type="boolean")
  269.      */
  270.     protected $alreadyPaid false;
  271.     /**
  272.      * @ORM\OneToMany(targetEntity="Diplix\KMGBundle\Entity\Payment", fetch="EAGER", mappedBy="order")
  273.      * @var Collection<Payment>
  274.      */
  275.     protected Collection $paymentReference;
  276.     /**
  277.      * @ORM\Column(type="string")
  278.      */
  279.     protected $confirmationPin '';
  280.     /**
  281.      * @ORM\Column(type="integer")
  282.      */
  283.     protected $preferredConfirmationMethod self::CM_SIGNATURE;
  284.     /**
  285.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\CoopMember")
  286.      * @ORM\JoinColumn(name="assigned_to_id",nullable=true)
  287.      */
  288.     protected $assignedTo null;
  289.     /**
  290.      * @ORM\Column(type="boolean")
  291.      */
  292.     protected $assignmentConfirmed false;
  293.     /**
  294.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\User")
  295.      * @ORM\JoinColumn(nullable=true)
  296.      */
  297.     protected ?User $assignmentUser null;
  298.     /**
  299.      * @ORM\Column(type="integer")
  300.      */
  301.     protected $assignmentStatus self::AS_NONE;
  302.     /**
  303.      * @ORM\Column(type="datetime")
  304.      * @ORM\Version
  305.      */
  306.     protected $version;
  307.     /**
  308.      * @ORM\OneToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\Job", mappedBy="knownOrder", cascade={"persist"} )
  309.      * @ORM\JoinColumn(nullable=true)
  310.      */
  311.     protected $job;
  312.     /**
  313.      * @ORM\Column(type="datetime",nullable=true)
  314.      */
  315.     protected $instantOrderInitiated;
  316.     /**
  317.      * @ORM\Column(type="datetime",nullable=true)
  318.      */
  319.     protected $instantOrderResponded;
  320.     /**
  321.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\User")
  322.      * @ORM\JoinColumn(nullable=true)
  323.      */
  324.     protected $instantOrderRespondedBy;
  325.     /**
  326.      * @ORM\Column(type="text",nullable=true)
  327.      */
  328.     protected $instantOrderComment;
  329.     /**
  330.      * @ORM\Column(type="integer")
  331.      */
  332.     protected $instantOrderStatus 0;
  333.     /**
  334.      * @ORM\Column(type="datetime",nullable=true)
  335.      */
  336.     protected $orderInitiatedOn;
  337.     /**
  338.      * @ORM\Column(type="datetime",nullable=true)
  339.      */
  340.     protected $jobPdfRequestedOn;
  341.     /**
  342.      * @ORM\Column(type="boolean")
  343.      */
  344.     protected $blumTransferOnly false;
  345.     public static $generatorMap = array(
  346.         "1","2","3","4","5","6","7","8","9"
  347.     );
  348.     const XCHG_NONE 0;
  349.     const XCHG_SENT_TO_OTHER 10;
  350.     const XCHG_RECEIVED_FROM_OTHER 20;
  351.     /**
  352.      * @ORM\Column(type="integer")
  353.      */
  354.     protected $xchgStatus self::XCHG_NONE;
  355.     /**
  356.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Accounting\CoopMember")
  357.      * @ORM\JoinColumn(name="xchg_to_id",nullable=true)
  358.      */
  359.     protected $xchgTo;
  360.     /**
  361.      * @ORM\Column(type="string")
  362.      */
  363.     protected $xchgOrderId '';
  364.     /**
  365.      * @ORM\Column(type="integer")
  366.      */
  367.     protected $xchgOrderStatus 0// vgl. orderStatus
  368.     /**
  369.      * @ORM\Column(type="integer")
  370.      */
  371.     protected $xchgConfirmed false;
  372.     /**
  373.      * @ORM\Column(type="integer", options={"default":0})
  374.      */
  375.     protected $customerNotificationState 0;
  376.     const CNS_INITIAL_SMS 0x01;
  377.     /**
  378.      * @ORM\Column(type="decimal", nullable=true, precision=5, scale=2,options={"unsigned":false})
  379.      */
  380.     protected $discount 0.0;
  381.     public static function generatePin($len=6)
  382.     {
  383.         $pin '';
  384.         $max count(self::$generatorMap)-1;
  385.         for ($i=0$i $len$i++)
  386.         {
  387.             $r random_int(0,$max);
  388.             $pin .= self::$generatorMap[$r];
  389.         }
  390.         return $pin;
  391.     }
  392.     public function __toString()
  393.     {
  394.         return sprintf("Order#%d %s",$this->getId(),$this->getOrderId());
  395.     }
  396.     public function __construct()
  397.     {
  398.         $this->addressList = new ArrayCollection();
  399.         $this->paymentReference = new ArrayCollection();
  400.         $this->childOrders = new ArrayCollection();
  401.         $this->confirmationPin self::generatePin();
  402.         $this->viewSecret self::generatePin(8);
  403.     }
  404.     public function __clone()
  405.     {
  406.         $this->id null;
  407.         $this->orderId '';
  408.         $this->remoteOrderId '';
  409.         $this->confirmationPin self::generatePin();
  410.         $this->remoteOrderSubmittedTime null;
  411.         $this->remoteStatus self::REMOTE_PENDING;
  412.         $this->orderStatus null;
  413.         $oldList $this->addressList;
  414.         $this->addressList = new ArrayCollection();
  415.         foreach ($oldList->toArray() as $elem)
  416.         {
  417.             $this->addAddress(clone $elem);
  418.         }
  419.         $this->returnFlightNo'';
  420.         $this->returnOrderTime=null;
  421.         $this->referencedParentOrder null;
  422.         $this->alreadyPaid false;
  423.         $this->lastEstimatedDistance 0;
  424.         $this->lastEstimatedPrice 0;
  425.         $this->assignedTo null;
  426.         $this->assignmentConfirmed false;
  427.         $this->assignmentUser null;
  428.         $this->customerNotificationState 0;
  429.         $this->job null;
  430.         $this->instantOrderStatus 0;
  431.         $this->instantOrderComment null;
  432.         $this->instantOrderInitiated null;
  433.         $this->instantOrderRespondedBy null;
  434.         $this->instantOrderResponded null;
  435.         $this->jobPdfRequestedOn null;
  436.         $this->xchgStatus self::XCHG_NONE;
  437.         $this->xchgOrderStatus 0;
  438.         $this->xchgTo null;
  439.         $this->xchgOrderId '';
  440.         $this->xchgConfirmed false;
  441.         // remove relations
  442.         $this->paymentReference = new ArrayCollection();
  443.         $this->childOrders = new ArrayCollection();
  444.     }
  445.     public function isDraft(): bool
  446.     {
  447.         // new 2020 behavior
  448.         if ($this->getOrderStatus()->getId()===OrderStatus::STATUS_DRAFT)
  449.         {
  450.             return true;
  451.         }
  452.         // backward compatibility
  453.         /** @noinspection TypeUnsafeComparisonInspection */
  454.         return ($this->remoteStatus == self::REMOTE_PENDING);
  455.     }
  456.     /**
  457.      * @param Order $parent
  458.      * @param Order|mixed $child
  459.      * @return Order
  460.      */
  461.     public static function createOrUpdateChildOrder(Order $parent$child)
  462.     {
  463.         if (!is_object($child))
  464.         {
  465.             $child = clone($parent);
  466.             $child->setReferencedParentOrder($parent);
  467.         }
  468.         else
  469.         {
  470.             // copy all addresses from parent order (to reflect changes)
  471.             foreach ($child->getAddressList() as $a$a->setBeDeleted(true);
  472.             foreach ($parent->getAddressList() as $a)
  473.             {
  474.                 $child->addAddress(clone $a);
  475.             }
  476.         }
  477.         // setup addresses in reverse order
  478.         $addresses $child->getAddressList()->toArray();
  479.         /** @var Address $a */
  480.         $sort  count($addresses);
  481.         foreach ($addresses as $a)
  482.         {
  483.             $a->setSortOrder($sort--);
  484.         }
  485.         // copy other fields
  486.         $pa PropertyAccess::createPropertyAccessor();
  487.         foreach([   'personCount',
  488.                     'personAsChildrenCount',
  489.                     'ccEmail',
  490.                     'carType',
  491.                     'paymentType',
  492.                     'costCenter',
  493.                     'comment',
  494.                     'internalComment',
  495.                     'ordererName',
  496.                     'ordererForename',
  497.                     'ordererPhone',
  498.                     'ordererMail',
  499.                     'childSeatCount',
  500.                     'childSeatInfo',
  501.                     'creditCardNo',
  502.                     'creditCardMonth',
  503.                     'creditCardYear',
  504.                     'isVip',
  505.                     'extraApproaches',
  506.                     'extraLuggage',
  507.                     'extraBicycles'] as $k)
  508.         {
  509.             $pa->setValue($child,$k$pa->getValue($parent,$k) );
  510.         }
  511.         // set fields from return fields
  512.         $child->setOrderTime($parent->getReturnOrderTime());
  513.         $child->setFlightNo($parent->getReturnFlightNo());
  514.         $child->setLastEstimatedPrice(0);
  515.         $child->setLastEstimatedDistance($parent->getLastEstimatedDistance());
  516.         // all done
  517.         return $child;
  518.     }
  519.     public function getFinalPrice()
  520.     {
  521.         if ($this->getFixedPrice()!==null)
  522.             return $this->getFixedPrice();
  523.         else
  524.             return $this->getLastEstimatedPrice();
  525.     }
  526.     /**
  527.      * @return mixed
  528.      */
  529.     public function getId()
  530.     {
  531.         return $this->id;
  532.     }
  533.     /**
  534.      * @return Customer
  535.      */
  536.     public function getCustomer()
  537.     {
  538.         return $this->customer;
  539.     }
  540.     /**
  541.      * @param mixed $customer
  542.      */
  543.     public function setCustomer($customer)
  544.     {
  545.         $this->customer $customer;
  546.     }
  547.     /**
  548.      * @return \DateTime
  549.      */
  550.     public function getOrderTime()
  551.     {
  552.         return $this->orderTime;
  553.     }
  554.     /**
  555.      * @param mixed $orderTime
  556.      */
  557.     public function setOrderTime($orderTime)
  558.     {
  559.         $this->orderTime $orderTime;
  560.     }
  561.     /**
  562.      * @return OrderStatus
  563.      */
  564.     public function getOrderStatus()
  565.     {
  566.         return $this->orderStatus;
  567.     }
  568.     /**
  569.      * @param mixed $orderStatus
  570.      */
  571.     public function setOrderStatus($orderStatus)
  572.     {
  573.         $this->orderStatus $orderStatus;
  574.     }
  575.     /**
  576.      * @return mixed
  577.      */
  578.     public function getPersonCount()
  579.     {
  580.         return $this->personCount;
  581.     }
  582.     /**
  583.      * @param mixed $personCount
  584.      */
  585.     public function setPersonCount($personCount)
  586.     {
  587.         $this->personCount $personCount;
  588.     }
  589.     /**
  590.      * @return PaymentType
  591.      */
  592.     public function getPaymentType()
  593.     {
  594.         return $this->paymentType;
  595.     }
  596.     /**
  597.      * @param mixed $paymentType
  598.      */
  599.     public function setPaymentType($paymentType)
  600.     {
  601.         $this->paymentType $paymentType;
  602.     }
  603.     /**
  604.      * @return mixed
  605.      */
  606.     public function getCostCenter()
  607.     {
  608.         return $this->costCenter;
  609.     }
  610.     /**
  611.      * @param mixed $costCenter
  612.      */
  613.     public function setCostCenter($costCenter)
  614.     {
  615.         $this->costCenter $costCenter;
  616.     }
  617.     /**
  618.      * @return mixed
  619.      */
  620.     public function getComment()
  621.     {
  622.         return $this->comment;
  623.     }
  624.     /**
  625.      * @param mixed $comment
  626.      */
  627.     public function setComment($comment)
  628.     {
  629.         $this->comment $comment;
  630.     }
  631.     /**
  632.      * @return mixed
  633.      */
  634.     public function getOrdererName()
  635.     {
  636.         return $this->ordererName;
  637.     }
  638.     /**
  639.      * @param mixed $ordererName
  640.      */
  641.     public function setOrdererName($ordererName)
  642.     {
  643.         $this->ordererName $ordererName;
  644.     }
  645.     /**
  646.      * @return mixed
  647.      */
  648.     public function getOrdererForename()
  649.     {
  650.         return $this->ordererForename;
  651.     }
  652.     /**
  653.      * @param mixed $ordererForename
  654.      */
  655.     public function setOrdererForename($ordererForename)
  656.     {
  657.         $this->ordererForename $ordererForename;
  658.     }
  659.     /**
  660.      * @return mixed
  661.      */
  662.     public function getOrdererPhone()
  663.     {
  664.         return $this->ordererPhone;
  665.     }
  666.     /**
  667.      * @param mixed $ordererPhone
  668.      */
  669.     public function setOrdererPhone($ordererPhone)
  670.     {
  671.         $this->ordererPhone $ordererPhone;
  672.     }
  673.     /**
  674.      * @return mixed
  675.      */
  676.     public function getOrdererMail()
  677.     {
  678.         return $this->ordererMail;
  679.     }
  680.     /**
  681.      * @param mixed $ordererMail
  682.      */
  683.     public function setOrdererMail($ordererMail)
  684.     {
  685.         $this->ordererMail $ordererMail;
  686.     }
  687.     public function addAddressList(Address $a) { return $this->addAddress($a); } // for reflection usage
  688.     public function addAddress(Address $a)
  689.     {
  690.         $a->setOwningOrder($this);
  691.         $this->addressList->add($a);
  692.     }
  693.     public function removeAddressList(Address $a) { return $this->removeAddress($a); } // for reflection usage
  694.     public function removeAddress(Address $a)
  695.     {
  696.         $this->addressList->removeElement($a);
  697.     }
  698.     public function clearAddressList()
  699.     {
  700.         $this->addressList->clear();
  701.     }
  702.     public function getAddressList()
  703.     {
  704.         $al $this->addressList;
  705.         // if the list is not loaded from the database, the order may be incorrect -> sort it
  706.         $iterator $al->getIterator();
  707.         $iterator->uasort(function ($a$b) {
  708.             return ($a->getSortOrder() < $b->getSortOrder()) ? -1;
  709.         });
  710.         $res = new ArrayCollection(iterator_to_array($iterator));
  711.         /*// cls: debug
  712.         $i=0;
  713.         foreach ($res as $a)
  714.         {
  715.             echo ($i++)." : ".$a->getId()." : ".$a->getSortOrder()." || ";
  716.         }*/
  717.         return $res;
  718.     }
  719.     public function removeDeletedAddressesFromList()
  720.     {
  721.         $adr $this->addressList->toArray();
  722.         $this->addressList = new ArrayCollection(array_filter($adr, function(Address $a) {
  723.             return !$a->getBeDeleted();
  724.         }));
  725.     }
  726.     public function reorganizeSortOrder()
  727.     {
  728.         // an sortOrder of < 0 may cause strange behaviour for which it is not that easy to find the problem source
  729.         // just assign new sortorders > 0. getAddressList() already returns the list in the right order
  730.         $al $this->getAddressList();
  731.         $sort 0;
  732.         foreach ($al as $a$a->setSortOrder($sort++);
  733.     }
  734.     /**
  735.      * @return mixed
  736.      */
  737.     public function getRemoteStatus()
  738.     {
  739.         return $this->remoteStatus;
  740.     }
  741.     /**
  742.      * @param mixed $remoteStatus
  743.      */
  744.     public function setRemoteStatus($remoteStatus)
  745.     {
  746.         $this->remoteStatus $remoteStatus;
  747.     }
  748.     /**
  749.      * @return mixed
  750.      */
  751.     public function getRemoteResult()
  752.     {
  753.         return $this->remoteResult;
  754.     }
  755.     /**
  756.      * @param mixed $remoteResult
  757.      */
  758.     public function setRemoteResult($remoteResult)
  759.     {
  760.         $this->remoteResult $remoteResult;
  761.     }
  762.     /**
  763.      * @return string
  764.      */
  765.     public function getRemoteOrderId(): string
  766.     {
  767.         return $this->remoteOrderId;
  768.     }
  769.     /**
  770.      * @param string $remoteOrderId
  771.      */
  772.     public function setRemoteOrderId(string $remoteOrderId): void
  773.     {
  774.         $this->remoteOrderId $remoteOrderId;
  775.     }
  776.     /**
  777.      * @return mixed
  778.      */
  779.     public function getOrderId()
  780.     {
  781.         return $this->orderId;
  782.     }
  783.     /**
  784.      * @param mixed $orderId
  785.      */
  786.     public function setOrderId($orderId)
  787.     {
  788.         $this->orderId $orderId;
  789.     }
  790.     /**
  791.      * @return mixed
  792.      */
  793.     public function getRemoteResultText()
  794.     {
  795.         return $this->remoteResultText;
  796.     }
  797.     /**
  798.      * @param mixed $remoteResultText
  799.      */
  800.     public function setRemoteResultText($remoteResultText)
  801.     {
  802.         $this->remoteResultText $remoteResultText;
  803.     }
  804.     /**
  805.      * @return mixed
  806.      */
  807.     public function getCcEmail()
  808.     {
  809.         return $this->ccEmail;
  810.     }
  811.     /**
  812.      * @param mixed $ccEmail
  813.      */
  814.     public function setCcEmail($ccEmail)
  815.     {
  816.         $this->ccEmail $ccEmail;
  817.     }
  818.     /**
  819.      * @return mixed
  820.      */
  821.     public function getChildSeatCount()
  822.     {
  823.         return $this->childSeatCount;
  824.     }
  825.     /**
  826.      * @param mixed $childSeatCount
  827.      */
  828.     public function setChildSeatCount($childSeatCount)
  829.     {
  830.         $this->childSeatCount $childSeatCount;
  831.     }
  832.     /**
  833.      * @return mixed
  834.      */
  835.     public function getFlightNo()
  836.     {
  837.         return $this->flightNo;
  838.     }
  839.     /**
  840.      * @param mixed $flightNo
  841.      */
  842.     public function setFlightNo($flightNo)
  843.     {
  844.         $this->flightNo $flightNo;
  845.     }
  846.     /**
  847.      * @return mixed
  848.      */
  849.     public function getChildSeatInfo()
  850.     {
  851.         return $this->childSeatInfo;
  852.     }
  853.     /**
  854.      * @param mixed $childSeatInfo
  855.      */
  856.     public function setChildSeatInfo($childSeatInfo)
  857.     {
  858.         $this->childSeatInfo $childSeatInfo;
  859.     }
  860.     /**
  861.      * @return mixed
  862.      */
  863.     public function getCarType()
  864.     {
  865.         return $this->carType;
  866.     }
  867.     /**
  868.      * @param mixed $carType
  869.      */
  870.     public function setCarType($carType)
  871.     {
  872.         $this->carType $carType;
  873.     }
  874.     /**
  875.      * @return mixed
  876.      */
  877.     public function getCarTypeSize()
  878.     {
  879.         return $this->carTypeSize;
  880.     }
  881.     /**
  882.      * @param mixed $carTypeSize
  883.      */
  884.     public function setCarTypeSize($carTypeSize)
  885.     {
  886.         $this->carTypeSize $carTypeSize;
  887.     }
  888.     /**
  889.      * @return mixed
  890.      */
  891.     public function getCreditCardNo()
  892.     {
  893.         return $this->creditCardNo;
  894.     }
  895.     /**
  896.      * @param mixed $creditCardNo
  897.      */
  898.     public function setCreditCardNo($creditCardNo)
  899.     {
  900.         $this->creditCardNo $creditCardNo;
  901.     }
  902.     /**
  903.      * @return mixed
  904.      */
  905.     public function getCreditCardMonth()
  906.     {
  907.         return $this->creditCardMonth;
  908.     }
  909.     /**
  910.      * @param mixed $creditCardMonth
  911.      */
  912.     public function setCreditCardMonth($creditCardMonth)
  913.     {
  914.         $this->creditCardMonth $creditCardMonth;
  915.     }
  916.     /**
  917.      * @return mixed
  918.      */
  919.     public function getCreditCardYear()
  920.     {
  921.         return $this->creditCardYear;
  922.     }
  923.     /**
  924.      * @param mixed $creditCardYear
  925.      */
  926.     public function setCreditCardYear($creditCardYear)
  927.     {
  928.         $this->creditCardYear $creditCardYear;
  929.     }
  930.     /**
  931.      * @return mixed
  932.      */
  933.     public function getLastEstimatedDistance()
  934.     {
  935.         return $this->lastEstimatedDistance;
  936.     }
  937.     /**
  938.      * @param mixed $lastEstimatedDistance
  939.      */
  940.     public function setLastEstimatedDistance($lastEstimatedDistance)
  941.     {
  942.         $this->lastEstimatedDistance = (int)$lastEstimatedDistance;
  943.     }
  944.     /**
  945.      * @return mixed
  946.      */
  947.     public function getLastEstimatedPrice()
  948.     {
  949.         return $this->lastEstimatedPrice;
  950.     }
  951.     /**
  952.      * @param mixed $lastEstimatedPrice
  953.      */
  954.     public function setLastEstimatedPrice($lastEstimatedPrice)
  955.     {
  956.         $this->lastEstimatedPrice $lastEstimatedPrice;
  957.     }
  958.     /**
  959.      * @return \DateTime|null
  960.      */
  961.     public function getRemoteOrderSubmittedTime()
  962.     {
  963.         return $this->remoteOrderSubmittedTime;
  964.     }
  965.     /**
  966.      * @param mixed $remoteOrderSubmittedTime
  967.      */
  968.     public function setRemoteOrderSubmittedTime($remoteOrderSubmittedTime)
  969.     {
  970.         $this->remoteOrderSubmittedTime $remoteOrderSubmittedTime;
  971.     }
  972. //    /**
  973. //     * @return mixed
  974. //     * @deprecated
  975. //     */
  976. //    public function getLastPriceListId()
  977. //    {
  978. //        return $this->lastPriceListId;
  979. //    }
  980. //
  981. //    /**
  982. //     * @param mixed $lastPriceListId
  983. //     * @deprecated
  984. //     */
  985. //    public function setLastPriceListId($lastPriceListId)
  986. //    {
  987. //        $this->lastPriceListId = $lastPriceListId;
  988. //    }
  989.     /**
  990.      * @return null|PriceList
  991.      */
  992.     public function getPriceList()
  993.     {
  994.         return $this->priceList;
  995.     }
  996.     /**
  997.      * @param mixed $priceList
  998.      */
  999.     public function setPriceList($priceList): void
  1000.     {
  1001.         $this->priceList $priceList;
  1002.         $this->lastPriceListId = ($priceList!==null?$priceList->getId():0);
  1003.     }
  1004.     /**
  1005.      * @return mixed
  1006.      */
  1007.     public function getIsVip()
  1008.     {
  1009.         return $this->isVip;
  1010.     }
  1011.     /**
  1012.      * @param mixed $isVip
  1013.      */
  1014.     public function setIsVip($isVip)
  1015.     {
  1016.         $this->isVip $isVip;
  1017.     }
  1018.     /**
  1019.      * @return mixed
  1020.      */
  1021.     public function getFixedPrice()
  1022.     {
  1023.         return $this->fixedPrice;
  1024.     }
  1025.     /**
  1026.      * @param mixed $fixedPrice
  1027.      */
  1028.     public function setFixedPrice($fixedPrice)
  1029.     {
  1030.         $this->fixedPrice $fixedPrice;
  1031.     }
  1032.     /**
  1033.      * @return mixed
  1034.      */
  1035.     public function getRegion()
  1036.     {
  1037.         return $this->region;
  1038.     }
  1039.     /**
  1040.      * @param mixed $region
  1041.      */
  1042.     public function setRegion($region)
  1043.     {
  1044.         $this->region $region;
  1045.     }
  1046.     /**
  1047.      * @return mixed
  1048.      */
  1049.     public function getisFamily()
  1050.     {
  1051.         return $this->isFamily;
  1052.     }
  1053.     /**
  1054.      * @param mixed $isFamily
  1055.      */
  1056.     public function setIsFamily($isFamily)
  1057.     {
  1058.         $this->isFamily $isFamily;
  1059.     }
  1060.     /**
  1061.      * @return mixed
  1062.      */
  1063.     public function getFamilyKidAddOn()
  1064.     {
  1065.         return $this->familyKidAddOn;
  1066.     }
  1067.     /**
  1068.      * @param mixed $familyKidAddOn
  1069.      */
  1070.     public function setFamilyKidAddOn($familyKidAddOn)
  1071.     {
  1072.         $this->familyKidAddOn $familyKidAddOn;
  1073.     }
  1074.     /**
  1075.      * @return mixed
  1076.      */
  1077.     public function getDestination()
  1078.     {
  1079.         return $this->destination;
  1080.     }
  1081.     /**
  1082.      * @param mixed $destination
  1083.      */
  1084.     public function setDestination($destination)
  1085.     {
  1086.         $this->destination $destination;
  1087.     }
  1088.     /**
  1089.      * @return mixed
  1090.      */
  1091.     public function getDirection()
  1092.     {
  1093.         return $this->direction;
  1094.     }
  1095.     /**
  1096.      * @param mixed $direction
  1097.      */
  1098.     public function setDirection($direction)
  1099.     {
  1100.         $this->direction $direction;
  1101.     }
  1102.     /**
  1103.      * @return Order|null
  1104.      */
  1105.     public function getReferencedParentOrder()
  1106.     {
  1107.         return $this->referencedParentOrder;
  1108.     }
  1109.     /**
  1110.      * @param Order|null $referencedParentOrder
  1111.      */
  1112.     public function setReferencedParentOrder($referencedParentOrder,$includeInverseSide=true)
  1113.     {
  1114.         $this->referencedParentOrder $referencedParentOrder;
  1115.         if ($includeInverseSide)
  1116.         {
  1117.             if ($referencedParentOrder!==null$referencedParentOrder->setChildOrder($this);
  1118.         }
  1119.     }
  1120.     /**
  1121.      * @return mixed
  1122.      */
  1123.     public function getExtraApproaches()
  1124.     {
  1125.         return $this->extraApproaches;
  1126.     }
  1127.     /**
  1128.      * @param mixed $extraApproaches
  1129.      */
  1130.     public function setExtraApproaches($extraApproaches)
  1131.     {
  1132.         $this->extraApproaches $extraApproaches;
  1133.     }
  1134.     /**
  1135.      * @return mixed
  1136.      */
  1137.     public function getExtraLuggage()
  1138.     {
  1139.         return $this->extraLuggage;
  1140.     }
  1141.     /**
  1142.      * @param mixed $extraLuggage
  1143.      */
  1144.     public function setExtraLuggage($extraLuggage)
  1145.     {
  1146.         $this->extraLuggage $extraLuggage;
  1147.     }
  1148.     /**
  1149.      * @return mixed
  1150.      */
  1151.     public function getExtraBicycles()
  1152.     {
  1153.         return $this->extraBicycles;
  1154.     }
  1155.     /**
  1156.      * @param mixed $extraBicycles
  1157.      */
  1158.     public function setExtraBicycles($extraBicycles)
  1159.     {
  1160.         $this->extraBicycles $extraBicycles;
  1161.     }
  1162.     /**
  1163.      * @return mixed
  1164.      */
  1165.     public function getReturnOrderTime()
  1166.     {
  1167.         return $this->returnOrderTime;
  1168.     }
  1169.     /**
  1170.      * @param mixed $returnOrderTime
  1171.      */
  1172.     public function setReturnOrderTime($returnOrderTime)
  1173.     {
  1174.         $this->returnOrderTime $returnOrderTime;
  1175.     }
  1176.     /**
  1177.      * @return mixed
  1178.      */
  1179.     public function getReturnFlightNo()
  1180.     {
  1181.         return $this->returnFlightNo;
  1182.     }
  1183.     /**
  1184.      * @param mixed $returnFlightNo
  1185.      */
  1186.     public function setReturnFlightNo($returnFlightNo)
  1187.     {
  1188.         $this->returnFlightNo $returnFlightNo;
  1189.     }
  1190.     /**
  1191.      * @return mixed
  1192.      */
  1193.     public function getFlightTime()
  1194.     {
  1195.         return $this->flightTime;
  1196.     }
  1197.     /**
  1198.      * @param mixed $flightTime
  1199.      */
  1200.     public function setFlightTime($flightTime)
  1201.     {
  1202.         $this->flightTime $flightTime;
  1203.     }
  1204.     /**
  1205.      * @return mixed
  1206.      */
  1207.     public function getFamilyAdultAddOn()
  1208.     {
  1209.         return $this->familyAdultAddOn;
  1210.     }
  1211.     /**
  1212.      * @param mixed $familyAdultAddOn
  1213.      */
  1214.     public function setFamilyAdultAddOn($familyAdultAddOn)
  1215.     {
  1216.         $this->familyAdultAddOn $familyAdultAddOn;
  1217.     }
  1218.     /**
  1219.      * @return mixed
  1220.      */
  1221.     public function getPersonAsChildrenCount()
  1222.     {
  1223.         return $this->personAsChildrenCount;
  1224.     }
  1225.     /**
  1226.      * @param mixed $personAsChildrenCount
  1227.      */
  1228.     public function setPersonAsChildrenCount($personAsChildrenCount)
  1229.     {
  1230.         $this->personAsChildrenCount $personAsChildrenCount;
  1231.     }
  1232.     /**
  1233.      * @return mixed
  1234.      */
  1235.     public function getAlreadyPaid()
  1236.     {
  1237.         return $this->alreadyPaid;
  1238.     }
  1239.     /**
  1240.      * @param mixed $alreadyPaid
  1241.      */
  1242.     public function setAlreadyPaid($alreadyPaid)
  1243.     {
  1244.         $this->alreadyPaid $alreadyPaid;
  1245.     }
  1246.     /**
  1247.      * @return Payment[]|ArrayCollection
  1248.      */
  1249.     public function getPaymentReference()
  1250.     {
  1251.         return $this->paymentReference;
  1252.     }
  1253.     /**
  1254.      * @param mixed $paymentReference
  1255.      */
  1256.     public function setPaymentReference($paymentReference)
  1257.     {
  1258.         $this->paymentReference $paymentReference;
  1259.     }
  1260.     /**
  1261.      * @return string
  1262.      */
  1263.     public function getConfirmationPin(): string
  1264.     {
  1265.         return $this->confirmationPin;
  1266.     }
  1267.     /**
  1268.      * @param string $confirmationPin
  1269.      */
  1270.     public function setConfirmationPin(string $confirmationPin): void
  1271.     {
  1272.         $this->confirmationPin $confirmationPin;
  1273.     }
  1274.     /**
  1275.      * @return null|CoopMember
  1276.      */
  1277.     public function getAssignedTo()
  1278.     {
  1279.         return $this->assignedTo;
  1280.     }
  1281.     /**
  1282.      * @param null|CoopMember $assignedTo
  1283.      */
  1284.     public function setAssignedTo($assignedTo): void
  1285.     {
  1286.         if ($assignedTo===null)
  1287.         {
  1288.             $this->setJobPdfRequestedOn(null);
  1289.         }
  1290.         else
  1291.         if ( ($this->assignedTo!==null) && ($assignedTo->getId() !== $this->assignedTo->getId()) )
  1292.         {
  1293.             $this->setJobPdfRequestedOn(null);
  1294.         }
  1295.         $this->assignedTo $assignedTo;
  1296.     }
  1297.     /**
  1298.      * @return mixed
  1299.      */
  1300.     public function getVersion()
  1301.     {
  1302.         return $this->version;
  1303.     }
  1304.     /**
  1305.      * @param mixed $version
  1306.      */
  1307.     public function setVersion($version): void
  1308.     {
  1309.         $this->version $version;
  1310.     }
  1311.     /**
  1312.      * @return bool
  1313.      */
  1314.     public function isAssignmentConfirmed(): bool
  1315.     {
  1316.         return $this->assignmentConfirmed;
  1317.     }
  1318.     /**
  1319.      * @param bool $assignmentConfirmed
  1320.      */
  1321.     public function setAssignmentConfirmed(bool $assignmentConfirmed, ?User $assignedUser null): void
  1322.     {
  1323.         $this->assignmentConfirmed $assignmentConfirmed;
  1324.         if ($assignmentConfirmed)
  1325.         {
  1326.             $this->assignmentUser $assignedUser;
  1327.         }
  1328.         else
  1329.         {
  1330.             $this->assignmentUser null;
  1331.         }
  1332.     }
  1333.     /**
  1334.      * @return int
  1335.      */
  1336.     public function getPreferredConfirmationMethod(): int
  1337.     {
  1338.         return $this->preferredConfirmationMethod;
  1339.     }
  1340.     /**
  1341.      * @param int $preferredConfirmationMethod
  1342.      */
  1343.     public function setPreferredConfirmationMethod(int $preferredConfirmationMethod): void
  1344.     {
  1345.         $this->preferredConfirmationMethod $preferredConfirmationMethod;
  1346.     }
  1347.     /**
  1348.      * @return null|Job
  1349.      */
  1350.     public function getJob()
  1351.     {
  1352.         return $this->job;
  1353.     }
  1354.     /**
  1355.      * @param mixed $job
  1356.      */
  1357.     public function setJob($job): void
  1358.     {
  1359.         $this->job $job;
  1360.     }
  1361.     /**
  1362.      * @return mixed
  1363.      */
  1364.     public function getInstantOrderInitiated()
  1365.     {
  1366.         return $this->instantOrderInitiated;
  1367.     }
  1368.     /**
  1369.      * @param mixed $instantOrderInitiated
  1370.      */
  1371.     public function setInstantOrderInitiated($instantOrderInitiated): void
  1372.     {
  1373.         $this->instantOrderInitiated $instantOrderInitiated;
  1374.     }
  1375.     /**
  1376.      * @return mixed
  1377.      */
  1378.     public function getInstantOrderComment()
  1379.     {
  1380.         return $this->instantOrderComment;
  1381.     }
  1382.     /**
  1383.      * @param mixed $instantOrderComment
  1384.      */
  1385.     public function setInstantOrderComment($instantOrderComment): void
  1386.     {
  1387.         $this->instantOrderComment $instantOrderComment;
  1388.     }
  1389.     /**
  1390.      * @return mixed
  1391.      */
  1392.     public function getInstantOrderResponded()
  1393.     {
  1394.         return $this->instantOrderResponded;
  1395.     }
  1396.     /**
  1397.      * @param mixed $instantOrderResponded
  1398.      */
  1399.     public function setInstantOrderResponded($instantOrderResponded): void
  1400.     {
  1401.         $this->instantOrderResponded $instantOrderResponded;
  1402.     }
  1403.     /**
  1404.      * @return mixed
  1405.      */
  1406.     public function getInstantOrderRespondedBy()
  1407.     {
  1408.         return $this->instantOrderRespondedBy;
  1409.     }
  1410.     /**
  1411.      * @param mixed $instantOrderRespondedBy
  1412.      */
  1413.     public function setInstantOrderRespondedBy($instantOrderRespondedBy): void
  1414.     {
  1415.         $this->instantOrderRespondedBy $instantOrderRespondedBy;
  1416.     }
  1417.     /**
  1418.      * @return int
  1419.      */
  1420.     public function getInstantOrderStatus(): int
  1421.     {
  1422.         return $this->instantOrderStatus;
  1423.     }
  1424.     /**
  1425.      * @param int $instantOrderStatus
  1426.      */
  1427.     public function setInstantOrderStatus(int $instantOrderStatus): void
  1428.     {
  1429.         $this->instantOrderStatus $instantOrderStatus;
  1430.     }
  1431.     /**
  1432.      * @return mixed
  1433.      */
  1434.     public function getOrderInitiatedOn()
  1435.     {
  1436.         return $this->orderInitiatedOn;
  1437.     }
  1438.     /**
  1439.      * @param mixed $orderInitiatedOn
  1440.      */
  1441.     public function setOrderInitiatedOn($orderInitiatedOn): void
  1442.     {
  1443.         $this->orderInitiatedOn $orderInitiatedOn;
  1444.     }
  1445.     public function setChildOrder(Order $child)
  1446.     {
  1447.         $exist $this->getChildOrder();
  1448.         if ($exist !== null)
  1449.         {
  1450.             if (($child!==null)&&($exist->getId() === $child->getId()))
  1451.             {
  1452.                 return; // already set
  1453.             }
  1454.             $exist->setReferencedParentOrder(null,false);
  1455.             $this->childOrders->clear();
  1456.         }
  1457.         if ($child !== null)
  1458.         {
  1459.             $this->childOrders->add($child);
  1460.             $child->setReferencedParentOrder($this,false);
  1461.         }
  1462.     }
  1463.     /**
  1464.      * @return Order|null
  1465.      */
  1466.     public function getChildOrder()
  1467.     {
  1468.         if ($this->childOrders->count()>1)
  1469.             throw new \LogicException("Multiple child orders are not supported !");
  1470.         if ($this->childOrders->count()===1)
  1471.             return $this->childOrders->first();
  1472.         return null;
  1473.     }
  1474.     /**
  1475.      * @return string
  1476.      */
  1477.     public function getInternalComment()
  1478.     {
  1479.         return $this->internalComment;
  1480.     }
  1481.     /**
  1482.      * @param string $internalComment
  1483.      */
  1484.     public function setInternalComment(string $internalComment)
  1485.     {
  1486.         $this->internalComment $internalComment;
  1487.     }
  1488.     /**
  1489.      * @return mixed
  1490.      */
  1491.     public function getJobPdfRequestedOn()
  1492.     {
  1493.         return $this->jobPdfRequestedOn;
  1494.     }
  1495.     /**
  1496.      * @param mixed $jobPdfRequestedOn
  1497.      */
  1498.     public function setJobPdfRequestedOn($jobPdfRequestedOn): void
  1499.     {
  1500.         $this->jobPdfRequestedOn $jobPdfRequestedOn;
  1501.     }
  1502.     /**
  1503.      * @return int
  1504.      */
  1505.     public function getAssignmentStatus(): int
  1506.     {
  1507.         return $this->assignmentStatus;
  1508.     }
  1509.     /**
  1510.      * @param int $assignmentStatus
  1511.      */
  1512.     public function setAssignmentStatus(int $assignmentStatus): void
  1513.     {
  1514.         $this->assignmentStatus $assignmentStatus;
  1515.     }
  1516.     /**
  1517.      * @return bool
  1518.      */
  1519.     public function isBlumTransferOnly(): bool
  1520.     {
  1521.         return $this->blumTransferOnly;
  1522.     }
  1523.     /**
  1524.      * @param bool $blumTransferOnly
  1525.      */
  1526.     public function setBlumTransferOnly(bool $blumTransferOnly): void
  1527.     {
  1528.         $this->blumTransferOnly $blumTransferOnly;
  1529.     }
  1530.     /**
  1531.      * @return mixed
  1532.      */
  1533.     public function getXchgStatus()
  1534.     {
  1535.         return $this->xchgStatus;
  1536.     }
  1537.     /**
  1538.      * @param mixed $xchgStatus
  1539.      */
  1540.     public function setXchgStatus($xchgStatus): void
  1541.     {
  1542.         $this->xchgStatus $xchgStatus;
  1543.     }
  1544.     /**
  1545.      * @return mixed
  1546.      */
  1547.     public function getXchgOrderStatus()
  1548.     {
  1549.         return $this->xchgOrderStatus;
  1550.     }
  1551.     /**
  1552.      * @param mixed $xchgOrderStatus
  1553.      */
  1554.     public function setXchgOrderStatus($xchgOrderStatus): void
  1555.     {
  1556.         $this->xchgOrderStatus $xchgOrderStatus;
  1557.     }
  1558.     /**
  1559.      * @return CoopMember|null
  1560.      */
  1561.     public function getXchgTo()
  1562.     {
  1563.         return $this->xchgTo;
  1564.     }
  1565.     /**
  1566.      * @param mixed $xchgTo
  1567.      */
  1568.     public function setXchgTo($xchgTo): void
  1569.     {
  1570.         $this->xchgTo $xchgTo;
  1571.     }
  1572.     /**
  1573.      * @return string
  1574.      */
  1575.     public function getXchgOrderId(): string
  1576.     {
  1577.         return $this->xchgOrderId;
  1578.     }
  1579.     /**
  1580.      * @param string $xchgOrderId
  1581.      */
  1582.     public function setXchgOrderId(string $xchgOrderId): void
  1583.     {
  1584.         $this->xchgOrderId $xchgOrderId;
  1585.     }
  1586.     /**
  1587.      * @return bool
  1588.      */
  1589.     public function isXchgConfirmed(): bool
  1590.     {
  1591.         return $this->xchgConfirmed;
  1592.     }
  1593.     /**
  1594.      * @param bool $xchgConfirmed
  1595.      */
  1596.     public function setXchgConfirmed(bool $xchgConfirmed): void
  1597.     {
  1598.         $this->xchgConfirmed $xchgConfirmed;
  1599.     }
  1600.     /**
  1601.      * @return string
  1602.      */
  1603.     public function getOriginOrderId(): string
  1604.     {
  1605.         return $this->originOrderId;
  1606.     }
  1607.     /**
  1608.      * @param string $originOrderId
  1609.      */
  1610.     public function setOriginOrderId(string $originOrderId): void
  1611.     {
  1612.         $this->originOrderId $originOrderId;
  1613.     }
  1614.     /**
  1615.      * @return User|null
  1616.      */
  1617.     public function getAssignmentUser(): ?User
  1618.     {
  1619.         return $this->assignmentUser;
  1620.     }
  1621.     /**
  1622.      * @return int
  1623.      */
  1624.     public function getCustomerNotificationState(): int
  1625.     {
  1626.         return $this->customerNotificationState;
  1627.     }
  1628.     /**
  1629.      * @param int $customerNotificationState
  1630.      */
  1631.     public function setCustomerNotificationState(int $customerNotificationState): void
  1632.     {
  1633.         $this->customerNotificationState $customerNotificationState;
  1634.     }
  1635.     /**
  1636.      * @return string
  1637.      */
  1638.     public function getViewSecret(): string
  1639.     {
  1640.         return $this->viewSecret;
  1641.     }
  1642.     /**
  1643.      * @param string $viewSecret
  1644.      */
  1645.     public function setViewSecret(string $viewSecret): void
  1646.     {
  1647.         $this->viewSecret $viewSecret;
  1648.     }
  1649.     /**
  1650.      * @return ?float
  1651.      */
  1652.     public function getDiscount(): ?float
  1653.     {
  1654.         return $this->discount;
  1655.     }
  1656.     /**
  1657.      * @param float $discount
  1658.      */
  1659.     public function setDiscount(?float $discount): void
  1660.     {
  1661.         $this->discount $discount;
  1662.     }
  1663. }