Example #1
0
 /**
  * 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;
 }
Example #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;
 }
Example #3
0
 /**
  * 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;
 }
Example #4
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());
     }
     return $newItem;
 }
Example #5
0
 /**
  * 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);
 }