src/ShopBundle/objects/db/TShopOrder.class.php
public function UpdateStock($bRemoveFromStock)
    {
        $oOrderItemList = $this->GetFieldShopOrderItemList();
        $oOrderItemList->GoToStart();
        while ($oOrderItem = $oOrderItemList->Next()) {
            $oItem = $oOrderItem->GetFieldShopArticle();
            if ($oItem) {
                $dAmount = $oOrderItem->fieldOrderAmount;
                if ($bRemoveFromStock) {
                    $dAmount = -1 * $dAmount;
                }
                $oItem->UpdateStock($dAmount, true, true);
            }
        }
        $oOrderItemList->GoToStart();
    }
public function UpdateStock($bRemoveFromStock)
    {
        $oOrderItemList = $this->GetFieldShopOrderItemList();
        $oOrderItemList->GoToStart();
        while ($oOrderItem = $oOrderItemList->Next()) {
            $oItem = $oOrderItem->GetFieldShopArticle();
            if ($oItem) {
                $dAmount = $oOrderItem->fieldOrderAmount;
                if ($bRemoveFromStock) {
                    $dAmount = -1 * $dAmount;
                }
                $oItem->UpdateStock($dAmount, true, true);
            }
        }
        $oOrderItemList->GoToStart();
    }
public function UpdateStock ( $ bRemoveFromStock ) { $ oOrderItemList = $ this -> GetFieldShopOrderItemList ( ) ; $ oOrderItemList -> GoToStart ( ) ; while ( $ oOrderItem = $ oOrderItemList -> Next ( ) ) { $ oItem = $ oOrderItem -> GetFieldShopArticle ( ) ; if ( $ oItem ) { $ dAmount = $ oOrderItem -> fieldOrderAmount ; if ( $ bRemoveFromStock ) { $ dAmount = - 1 * $ dAmount ; } $ oItem -> UpdateStock ( $ dAmount , true , true ) ; } } $ oOrderItemList -> GoToStart ( ) ; }
remove or add the stock of the order back into the product pool.

@param bool $bRemoveFromStock
remove or add the stock of the order back into the product pool .