当前位置: 首页>>代码示例>>PHP>>正文


PHP ActiveRecord::clearArrayData方法代码示例

本文整理汇总了PHP中ActiveRecord::clearArrayData方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::clearArrayData方法的具体用法?PHP ActiveRecord::clearArrayData怎么用?PHP ActiveRecord::clearArrayData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActiveRecord的用法示例。


在下文中一共展示了ActiveRecord::clearArrayData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDefaultZoneVAT

 public function testDefaultZoneVAT()
 {
     $taxRate = TaxRate::getNewInstance(DeliveryZone::getDefaultZoneInstance(), $this->tax, 10);
     $taxRate->save();
     $order = CustomerOrder::getNewInstance($this->user);
     $order->addProduct($this->product, 1, true);
     $order->currency->set($this->currency);
     $order->save();
     $this->assertEqual($order->getTotal(), 100);
     $order->finalize();
     $this->assertDefaultZoneOrder($order, $this->currency);
     ActiveRecord::clearPool();
     ActiveRecord::clearArrayData();
     $reloaded = CustomerOrder::getInstanceById($order->getID(), true);
     /* debug
     	    $reloaded->getShipments();
     	    $arr = $reloaded->toArray();
     		foreach($arr['cartItems'][0] as $k=>$v)
     			if(!is_array($v))
     				echo $k.' : '.$v."\n";
     		*/
     $this->assertDefaultZoneOrder($reloaded, $this->currency);
 }
开发者ID:saiber,项目名称:livecart,代码行数:23,代码来源:TaxRateTest.php

示例2: changeCurrency

 public function changeCurrency(Currency $currency, $save = true)
 {
     $this->currency->set($currency);
     foreach ($this->getOrderedItems() as $item) {
         $item->price->set($item->getProduct()->getItemPrice($item, true, $currency));
         $item->setItemPrice($item->price->get());
         if ($save) {
             $item->save();
         }
     }
     if ($save) {
         $this->save();
     }
     // otherwise old currency price "sticks" for this request
     ActiveRecord::clearArrayData();
 }
开发者ID:saiber,项目名称:livecart,代码行数:16,代码来源:CustomerOrder.php

示例3: loadData

 protected function loadData()
 {
     ActiveRecord::clearArrayData();
     $this->data = ActiveRecord::getRecordSetArray($this->table, $this->filter, $this->referencedRecords);
 }
开发者ID:saiber,项目名称:www,代码行数:5,代码来源:ARFeed.php

示例4: completed

 /**
  *	@role login
  */
 public function completed()
 {
     if ($this->request->isValueSet('id')) {
         return new ActionRedirectResponse('checkout', 'completeExternal', array('id' => $this->request->get('id')));
     }
     ActiveRecord::clearPool();
     ActiveRecord::clearArrayData();
     $order = CustomerOrder::getInstanceByID((int) $this->session->get('completedOrderID'), CustomerOrder::LOAD_DATA);
     $order->getTaxAmount();
     $order->loadAll();
     $order->getTaxAmount();
     ActiveRecord::clearArrayData();
     $arr = $order->toArray();
     $response = new ActionResponse();
     $response->set('order', $arr);
     $response->set('url', $this->router->createUrl(array('controller' => 'user', 'action' => 'viewOrder', 'id' => $this->session->get('completedOrderID')), true));
     if (!$order->isPaid->get()) {
         $transactions = $order->getTransactions()->toArray();
         $response->set('transactions', $transactions);
     } else {
         $response->set('files', ProductFile::getOrderFiles(select(eq('CustomerOrder.ID', $order->getID()))));
     }
     return $response;
 }
开发者ID:saiber,项目名称:www,代码行数:27,代码来源:CheckoutController.php


注:本文中的ActiveRecord::clearArrayData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。