public function getStock()
    {
        if ($this->getStockType() !== ElcodiProductStock::INHERIT_STOCK) {
            return $this->stock;
        }

        $stock = ElcodiProductStock::INFINITE_STOCK;
        foreach ($this->getPurchasables() as $purchasable) {
            $purchasableStock = $purchasable->getStock();
            if (is_int($purchasableStock) && (
                    !is_int($stock) ||
                    $purchasableStock < $stock
                )) {
                $stock = $purchasableStock;
            }
        }

        return $stock;
    }
public function getStock()
    {
        if ($this->getStockType() !== ElcodiProductStock::INHERIT_STOCK) {
            return $this->stock;
        }

        $stock = ElcodiProductStock::INFINITE_STOCK;
        foreach ($this->getPurchasables() as $purchasable) {
            $purchasableStock = $purchasable->getStock();
            if (is_int($purchasableStock) && (
                    !is_int($stock) ||
                    $purchasableStock < $stock
                )) {
                $stock = $purchasableStock;
            }
        }

        return $stock;
    }
public function getStock ( ) { if ( $ this -> getStockType ( ) !== ElcodiProductStock :: INHERIT_STOCK ) { return $ this -> stock ; } $ stock = ElcodiProductStock :: INFINITE_STOCK ; foreach ( $ this -> getPurchasables ( ) as $ purchasable ) { $ purchasableStock = $ purchasable -> getStock ( ) ; if ( is_int ( $ purchasableStock ) && ( ! is_int ( $ stock ) || $ purchasableStock < $ stock ) ) { $ stock = $ purchasableStock ; } } return $ stock ; }
Get stock.

@return int Stock
Get stock .