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


PHP ProductRepositoryInterface::findOneByWithValues方法代码示例

本文整理汇总了PHP中Pim\Bundle\CatalogBundle\Repository\ProductRepositoryInterface::findOneByWithValues方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductRepositoryInterface::findOneByWithValues方法的具体用法?PHP ProductRepositoryInterface::findOneByWithValues怎么用?PHP ProductRepositoryInterface::findOneByWithValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pim\Bundle\CatalogBundle\Repository\ProductRepositoryInterface的用法示例。


在下文中一共展示了ProductRepositoryInterface::findOneByWithValues方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: findProductOr404

 /**
  * Find a product by its id or return a 404 response
  *
  * @param string $id the product id
  *
  * @throws NotFoundHttpException
  *
  * @return ProductInterface
  */
 protected function findProductOr404($id)
 {
     $product = $this->productRepository->findOneByWithValues($id);
     if (!$product) {
         throw new NotFoundHttpException(sprintf('Product with id %s could not be found.', (string) $id));
     }
     return $product;
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:17,代码来源:ProductCategoryController.php

示例2: addCurrentProduct

 /**
  * Inject current product in the datagrid configuration
  */
 protected function addCurrentProduct()
 {
     $path = $this->getSourcePath(self::CURRENT_PRODUCT_KEY);
     $id = $this->requestParams->get('product', null);
     $product = null !== $id ? $this->productRepository->findOneByWithValues($id) : null;
     $this->configuration->offsetSetByPath($path, $product);
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:10,代码来源:ContextConfigurator.php

示例3: getCurrentProduct

 /**
  * @return ProductInterface
  */
 protected function getCurrentProduct()
 {
     $productId = $this->extractor->getDatagridParameter('product');
     if (!$productId) {
         throw new \LogicException('The current product type must be configured');
     }
     $product = $this->productRepository->findOneByWithValues($productId);
     return $product;
 }
开发者ID:VinceBLOT,项目名称:pim-community-dev,代码行数:12,代码来源:IsAssociatedFilter.php

示例4: findProductOr404

 /**
  * Find a product by its id or return a 404 response
  *
  * @param string $id the product id
  *
  * @throws NotFoundHttpException
  *
  * @return ProductInterface
  */
 protected function findProductOr404($id)
 {
     $product = $this->productRepository->findOneByWithValues($id);
     $product = $this->objectFilter->filterObject($product, 'pim.internal_api.product.view') ? null : $product;
     if (!$product) {
         throw new NotFoundHttpException(sprintf('Product with id %s could not be found.', $id));
     }
     return $product;
 }
开发者ID:VinceBLOT,项目名称:pim-community-dev,代码行数:18,代码来源:ProductController.php

示例5: findPrevious

 /**
  * Find previous sequential edit entity
  *
  * @param SequentialEdit $sequentialEdit
  * @param int            $currentKey
  *
  * @return null|ProductInterface
  */
 protected function findPrevious(SequentialEdit $sequentialEdit, $currentKey)
 {
     $previous = null;
     $objectSet = $sequentialEdit->getObjectSet();
     while ($currentKey-- > 0 && null === $previous) {
         $previous = $this->productRepository->findOneByWithValues($objectSet[$currentKey]);
     }
     return $previous;
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:17,代码来源:SequentialEditManager.php

示例6: findProductOr404

 /**
  * Find a product by its id or return a 404 response
  *
  * @param int $id the product id
  *
  * @throws NotFoundHttpException
  *
  * @return ProductInterface
  */
 protected function findProductOr404($id)
 {
     $product = $this->productRepository->findOneByWithValues($id);
     if (!$product) {
         throw $this->createNotFoundException(sprintf('Product with id %s could not be found.', (string) $id));
     }
     // With this version of the form we need to add missing values from family
     $this->productBuilder->addMissingProductValues($product);
     $this->productBuilder->addMissingAssociations($product);
     return $product;
 }
开发者ID:VinceBLOT,项目名称:pim-community-dev,代码行数:20,代码来源:ProductController.php

示例7: find

 /**
  * Find a product by id
  * Also ensure that it contains all required values
  *
  * @param int $id
  *
  * @deprecated will be removed in 1.6
  *
  * @return ProductInterface|null
  */
 public function find($id)
 {
     $product = $this->productRepository->findOneByWithValues($id);
     return $product;
 }
开发者ID:VinceBLOT,项目名称:pim-community-dev,代码行数:15,代码来源:ProductManager.php


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