コード例 #1
0
ファイル: OrderAbstract.php プロジェクト: kewaunited/xcart
 /**
  * Reset surcharges list
  *
  * @return array
  */
 public function resetSurcharges()
 {
     $result = array('items' => array());
     foreach ($this->getItems() as $item) {
         $result['items'][$item->getItemId()] = $item->resetSurcharges();
     }
     $result['surcharges'] = parent::resetSurcharges();
     return $result;
 }
コード例 #2
0
 /**
  * Clone order item object. The product only is set additionally
  * since the order could be different and should be set manually
  *
  * @return \XLite\Model\AEntity
  */
 public function cloneEntity()
 {
     $newItem = parent::cloneEntity();
     if ($this->getObject()) {
         $newItem->setObject($this->getObject());
     }
     if ($this->hasAttributeValues()) {
         foreach ($this->getAttributeValues() as $av) {
             $cloned = $av->cloneEntity();
             $cloned->setOrderItem($newItem);
             $newItem->addAttributeValues($cloned);
         }
     }
     return $newItem;
 }
コード例 #3
0
ファイル: Order.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Reset surcharges list
  *
  * @return array
  */
 public function resetSurcharges()
 {
     $result = array('items' => array());
     $result['items'] = $this->resetItemsSurcharges($this->getItems()->toArray());
     $result['surcharges'] = parent::resetSurcharges();
     return $result;
 }
コード例 #4
0
ファイル: OrderItem.php プロジェクト: kingsj/core
 /**
  * Clone order item object. The product only is set additionally
  * since the order could be different and should be set manually
  *
  * @return \XLite\Model\AEntity
  */
 public function cloneEntity()
 {
     $newItem = parent::cloneEntity();
     if ($this->getObject()) {
         $newItem->setObject($this->getObject());
     }
     return $newItem;
 }
コード例 #5
0
ファイル: Order.php プロジェクト: kingsj/core
 /**
  * Constructor
  *
  * @param array $data Entity properties OPTIONAL
  *
  * @return void
  */
 public function __construct(array $data = array())
 {
     $this->details = new \Doctrine\Common\Collections\ArrayCollection();
     $this->items = new \Doctrine\Common\Collections\ArrayCollection();
     $this->surcharges = new \Doctrine\Common\Collections\ArrayCollection();
     $this->payment_transactions = new \Doctrine\Common\Collections\ArrayCollection();
     $this->events = new \Doctrine\Common\Collections\ArrayCollection();
     parent::__construct($data);
 }