Sylius\Behat\Context\Setup\ProductContext::thereIsQuantityOfProducts PHP Method

thereIsQuantityOfProducts() public method

public thereIsQuantityOfProducts ( $quantity, Sylius\Component\Core\Model\ProductInterface $product )
$product Sylius\Component\Core\Model\ProductInterface
    public function thereIsQuantityOfProducts($quantity, ProductInterface $product)
    {
        /** @var ProductVariantInterface $productVariant */
        $productVariant = $this->defaultVariantResolver->getVariant($product);
        $productVariant->setOnHand($quantity);
        $this->objectManager->flush();
    }