本文整理汇总了PHP中Pim\Bundle\CatalogBundle\Repository\ProductRepositoryInterface::getFullProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductRepositoryInterface::getFullProduct方法的具体用法?PHP ProductRepositoryInterface::getFullProduct怎么用?PHP ProductRepositoryInterface::getFullProduct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pim\Bundle\CatalogBundle\Repository\ProductRepositoryInterface
的用法示例。
在下文中一共展示了ProductRepositoryInterface::getFullProduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: completenessAction
/**
* Displays completeness for a product
*
* @param int $id
*
* @return Response
*/
public function completenessAction($id)
{
$product = $this->productRepository->getFullProduct($id);
$channels = $this->channelManager->getFullChannels();
$locales = $this->userContext->getUserLocales();
$completenesses = $this->completenessManager->getProductCompleteness($product, $channels, $locales, $this->userContext->getCurrentLocale()->getCode());
return $this->templating->renderResponse('PimEnrichBundle:Completeness:_completeness.html.twig', ['product' => $product, 'channels' => $channels, 'locales' => $locales, 'completenesses' => $completenesses]);
}
示例2: getAction
/**
* Get completeness for a product
*
* @param int $id
*
* @return JSONResponse
*/
public function getAction($id)
{
$product = $this->productRepository->getFullProduct($id);
$this->completenessManager->generateMissingForProduct($product);
$channels = $this->channelRepository->getFullChannels();
$locales = $this->userContext->getUserLocales();
$filteredLocales = $this->collectionFilter->filterCollection($locales, 'pim.internal_api.locale.view');
$completenesses = $this->completenessManager->getProductCompleteness($product, $channels, $filteredLocales, $this->userContext->getCurrentLocale()->getCode());
return new JsonResponse($this->completenessNormalizer->normalize($completenesses, 'internal_api'));
}