public function updateStockByLoadedStockUpdaters(
        PurchasableInterface $purchasable,
        $stockToDecrease
    ) {
        foreach ($this->stockUpdaters as $stockUpdater) {
            $stockUpdateNamespace = $stockUpdater->getPurchasableNamespace();
            if ($purchasable instanceof $stockUpdateNamespace) {
                return $stockUpdater->updateStock(
                    $purchasable,
                    $stockToDecrease
                );
            }
        }

        return false;
    }
public function updateStockByLoadedStockUpdaters(
        PurchasableInterface $purchasable,
        $stockToDecrease
    ) {
        foreach ($this->stockUpdaters as $stockUpdater) {
            $stockUpdateNamespace = $stockUpdater->getPurchasableNamespace();
            if ($purchasable instanceof $stockUpdateNamespace) {
                return $stockUpdater->updateStock(
                    $purchasable,
                    $stockToDecrease
                );
            }
        }

        return false;
    }
public function updateStockByLoadedStockUpdaters ( PurchasableInterface $ purchasable , $ stockToDecrease ) { foreach ( $ this -> stockUpdaters as $ stockUpdater ) { $ stockUpdateNamespace = $ stockUpdater -> getPurchasableNamespace ( ) ; if ( $ purchasable instanceof $ stockUpdateNamespace ) { return $ stockUpdater -> updateStock ( $ purchasable , $ stockToDecrease ) ; } } return false ; }
Update stock for a Purchasable instance given a collection of stock
updaters loaded.

@param PurchasableInterface $purchasable     Purchasable
@param int                  $stockToDecrease Stock to decrease

@return false|int Real decreased stock or false if error
Update stock for a Purchasable instance given a collection of stock updaters loaded .