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


PHP ProductRepositoryInterface::getEligibleProductIdsForVariantGroup方法代码示例

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


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

示例1: prepareParameters

 /**
  * @return array
  */
 protected function prepareParameters()
 {
     $queryParameters = parent::prepareParameters();
     $variantGroupId = $queryParameters['currentGroup'];
     if (null !== $variantGroupId) {
         $productIds = $this->productRepository->getEligibleProductIdsForVariantGroup($variantGroupId);
         if (count($productIds) === 0) {
             $productIds = [0];
         }
     } else {
         $productIds = [0];
     }
     $queryParameters['productIds'] = $productIds;
     return $queryParameters;
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:18,代码来源:AddParametersToVariantProductGridListener.php

示例2: execute

 /**
  * @param array $configuration
  */
 public function execute(array $configuration)
 {
     $actions = $configuration['actions'];
     $variantGroupCode = $actions['value'];
     $variantGroup = $this->groupRepository->findOneByIdentifier($variantGroupCode);
     $axisAttributeCodes = $this->getAxisAttributeCodes($variantGroup);
     $eligibleProductIds = $this->productRepository->getEligibleProductIdsForVariantGroup($variantGroup->getId());
     $cursor = $this->getProductsCursor($configuration['filters']);
     $paginator = $this->paginatorFactory->createPaginator($cursor);
     list($productAttributeAxis, $acceptedIds) = $this->filterDuplicateAxisCombinations($paginator, $eligibleProductIds, $axisAttributeCodes);
     $excludedIds = $this->addSkippedMessageForDuplicatedProducts($productAttributeAxis);
     $acceptedIds = array_diff($acceptedIds, $excludedIds);
     $configuration['filters'] = [['field' => 'id', 'operator' => 'IN', 'value' => $acceptedIds]];
     if (0 === count($acceptedIds)) {
         $configuration = null;
     }
     $this->setJobConfiguration(json_encode($configuration));
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:21,代码来源:VariantGroupCleaner.php


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