Beispiel #1
0
 /**
  * Clone order and all related data
  *
  * @return \XLite\Model\Order
  */
 public function cloneEntity()
 {
     $newOrder = parent::cloneEntity();
     foreach ($this->getUsedCoupons() as $usedCoupon) {
         $cloned = $usedCoupon->cloneEntity();
         $cloned->setOrder($newOrder);
         $newOrder->addUsedCoupons($cloned);
         if ($usedCoupon->getCoupon()) {
             $cloned->setCoupon($usedCoupon->getCoupon());
             $usedCoupon->getCoupon()->addUsedCoupons($cloned);
         }
     }
     return $newOrder;
 }
 /**
  * {@inheritDoc}
  */
 public function cloneEntity()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'cloneEntity', array());
     return parent::cloneEntity();
 }