本文整理汇总了PHP中Sylius\Component\Core\Model\ProductInterface::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductInterface::getId方法的具体用法?PHP ProductInterface::getId怎么用?PHP ProductInterface::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Component\Core\Model\ProductInterface
的用法示例。
在下文中一共展示了ProductInterface::getId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isThereProduct
/**
* {@inheritdoc}
*/
public function isThereProduct(ProductInterface $product)
{
if (!($table = $this->getDocument()->find('css', 'table'))) {
return false;
}
$row = $this->tableManipulator->getRowWithFields($table, ['id' => $product->getId()]);
return null === $row;
}
示例2: iDeleteTheProduct
/**
* @When /^I delete the ("[^"]+" product)$/
* @When /^I try to delete the ("([^"]+)" product)$/
*/
public function iDeleteTheProduct(ProductInterface $product)
{
try {
$this->sharedStorage->set('product_id', $product->getId());
$this->productRepository->remove($product);
} catch (DBALException $exception) {
$this->sharedStorage->set('last_exception', $exception);
}
}
示例3: theVariantOfProductShouldHaveItemsOnHold
/**
* @Then the :variant variant of :product product should have :amount items on hold
*/
public function theVariantOfProductShouldHaveItemsOnHold(ProductVariantInterface $variant, ProductInterface $product, $amount)
{
$this->indexPage->open(['productId' => $product->getId()]);
Assert::same($amount, $this->indexPage->getOnHoldQuantityFor($variant), sprintf('Unexpected on hold quantity for "%s" variant. It should be "%s" but is "%s"', $variant->getName(), $amount, $this->indexPage->getOnHandQuantityFor($variant)));
}
示例4: thisProductMainTaxonShouldBe
/**
* @Then /^(this product) main taxon should be "([^"]+)"$/
*/
public function thisProductMainTaxonShouldBe(ProductInterface $product, $taxonName)
{
/** @var UpdatePageInterface $currentPage */
$currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->updateSimpleProductPage, $this->updateConfigurableProductPage], $this->sharedStorage->get('product'));
$currentPage->open(['id' => $product->getId()]);
Assert::true($this->updateConfigurableProductPage->isMainTaxonChosen($taxonName), sprintf('The main taxon %s should be chosen, but it does not.', $taxonName));
}
示例5: thisProductShouldNoLongerHavePriceForChannel
/**
* @Then /^(this product) should no longer have price for channel "([^"]+)"$/
*/
public function thisProductShouldNoLongerHavePriceForChannel(ProductInterface $product, $channelName)
{
$this->updateSimpleProductPage->open(['id' => $product->getId()]);
try {
$this->updateSimpleProductPage->getPriceForChannel($channelName);
} catch (ElementNotFoundException $exception) {
return;
}
throw new \Exception(sprintf('Product "%s" should not have price defined for channel "%s".', $product->getName(), $channelName));
}
示例6: iWantToViewAllVariantsOfThisProduct
/**
* @When /^I (?:|want to )view all variants of (this product)$/
* @When /^I view(?:| all) variants of the (product "[^"]+")$/
*/
public function iWantToViewAllVariantsOfThisProduct(ProductInterface $product)
{
$this->indexPage->open(['productId' => $product->getId()]);
}
示例7: iWantToGenerateNewVariantsForThisProduct
/**
* @When /^I want to generate new variants for (this product)$/
*/
public function iWantToGenerateNewVariantsForThisProduct(ProductInterface $product)
{
$this->generatePage->open(['productId' => $product->getId()]);
}
示例8:
function it_tries_to_delete_a_product_that_does_not_exist(SharedStorageInterface $sharedStorage, RepositoryInterface $productRepository, ProductInterface $product)
{
$product->getId()->willReturn(1);
$productRepository->find(1)->willReturn(null);
$sharedStorage->set('deleted_product', $product)->shouldBeCalled();
$productRepository->remove($product)->willThrow(DBALException::class);
$sharedStorage->set('last_exception', Argument::type(DBALException::class))->shouldBeCalled();
$this->iDeleteTheProduct($product);
}
示例9: iDeleteProduct
/**
* @When I delete the :product product
*/
public function iDeleteProduct(ProductInterface $product)
{
$this->adminProductShowPage->open(['id' => $product->getId()]);
$this->adminProductShowPage->deleteProduct();
$this->sharedStorage->set('product', $product);
}