当前位置: 首页>>代码示例>>PHP>>正文


PHP ProductInterface::getId方法代码示例

本文整理汇总了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;
 }
开发者ID:Mozan,项目名称:Sylius,代码行数:11,代码来源:IndexPage.php

示例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);
     }
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:13,代码来源:ManagingProductsContext.php

示例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)));
 }
开发者ID:gabiudrescu,项目名称:Sylius,代码行数:8,代码来源:ManagingProductVariantsContext.php

示例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));
 }
开发者ID:TheMadeleine,项目名称:Sylius,代码行数:10,代码来源:ManagingProductsContext.php

示例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));
 }
开发者ID:sylius,项目名称:sylius,代码行数:13,代码来源:ManagingProductsContext.php

示例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()]);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:8,代码来源:ManagingProductVariantsContext.php

示例7: iWantToGenerateNewVariantsForThisProduct

 /**
  * @When /^I want to generate new variants for (this product)$/
  */
 public function iWantToGenerateNewVariantsForThisProduct(ProductInterface $product)
 {
     $this->generatePage->open(['productId' => $product->getId()]);
 }
开发者ID:NeverResponse,项目名称:Sylius,代码行数:7,代码来源:ManagingProductVariantsContext.php

示例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);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:9,代码来源:ProductContextSpec.php

示例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);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:9,代码来源:ProductContext.php


注:本文中的Sylius\Component\Core\Model\ProductInterface::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。