當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。