當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Inventory::__build方法代碼示例

本文整理匯總了PHP中Inventory::__build方法的典型用法代碼示例。如果您正苦於以下問題:PHP Inventory::__build方法的具體用法?PHP Inventory::__build怎麽用?PHP Inventory::__build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Inventory的用法示例。


在下文中一共展示了Inventory::__build方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testBuild

 /** @depends testConstruct */
 public function testBuild()
 {
     $inv = Inventory::__build(1, 1000, 1);
     $this->assertEquals(1, $inv->id);
     $this->assertEquals(1000, $inv->date);
     $this->assertEquals(1, $inv->locationId);
 }
開發者ID:booko,項目名稱:pasteque-server,代碼行數:8,代碼來源:InventoryTest.php

示例2: proceed

 protected function proceed()
 {
     $srv = new InventoriesService();
     switch ($this->action) {
         case 'save':
             $jsInv = json_decode($this->getParam("inventory"));
             $id = null;
             if (!property_exists($jsInv, 'id')) {
                 $jsInv->id = null;
             }
             $inv = Inventory::__build($jsInv->id, $jsInv->date, $jsInv->locationId);
             foreach ($jsInv->items as $item) {
                 if (!property_exists($item, 'missingQty')) {
                     $item->missingQty = null;
                 }
                 if (!property_exists($item, 'unitValue')) {
                     $item->unitValue = null;
                 }
                 if (!property_exists($item, "attrSetInstId")) {
                     $item->attrSetInstId = null;
                 }
                 $item = new InventoryItem($inv->id, $item->productId, $item->attrSetInstId, $item->qty, $item->lostQty, $item->defectQty, $item->missingQty, $item->unitValue);
                 $inv->addItem($item);
             }
             $inv->fillZero();
             $id = $srv->create($inv);
             if ($id !== false) {
                 $this->succeed($id);
             } else {
                 $this->fail(APIError::$ERR_GENERIC);
             }
             break;
     }
 }
開發者ID:booko,項目名稱:pasteque-server,代碼行數:34,代碼來源:InventoriesAPI.php

示例3: build

 protected function build($dbInv, $pdo = null)
 {
     $db = DB::get();
     $inv = Inventory::__build($dbInv['ID'], $db->readDate($dbInv['DATE']), $dbInv['LOCATION_ID'], $dbInv['PRODUCT_ID'], $dbInv['ATTRSETINST_ID'], $dbInv['QTY'], $dbInv['LOSTQTY'], $dbInv['DEFECTQTY'], $dbInv['MISSINGQTY'], $dbInv['UNITVALUE']);
     $stmt = $pdo->prepare("SELECT * FROM STOCK_INVENTORYCONTENT WHERE " . "INVENTORY_ID = :id");
     $stmt->bindParam(":id", $dbInv['ID']);
     $stmt->execute();
     while ($row = $stmt->fetch()) {
         $item = new InventoryItem($row['PRODUCT_ID'], $row['ATTRSETINST_ID'], $row['QTY'], $row['LOSTQTY'], $row['DEFECTQTY'], $row['MISSINGQTY'], $row['UNITVALUE']);
         $inv->addItem($item);
     }
     return $inv;
 }
開發者ID:booko,項目名稱:pasteque-server,代碼行數:13,代碼來源:InventoriesService.php


注:本文中的Inventory::__build方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。