當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ChannelManager::getFullChannels方法代碼示例

本文整理匯總了PHP中Pim\Bundle\CatalogBundle\Manager\ChannelManager::getFullChannels方法的典型用法代碼示例。如果您正苦於以下問題:PHP ChannelManager::getFullChannels方法的具體用法?PHP ChannelManager::getFullChannels怎麽用?PHP ChannelManager::getFullChannels使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Pim\Bundle\CatalogBundle\Manager\ChannelManager的用法示例。


在下文中一共展示了ChannelManager::getFullChannels方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: completenessAction

 /**
  * Displays completeness for a product
  *
  * @param int $id
  *
  * @return Response
  */
 public function completenessAction($id)
 {
     $product = $this->productManager->getProductRepository()->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', array('product' => $product, 'channels' => $channels, 'locales' => $locales, 'completenesses' => $completenesses));
 }
開發者ID:noglitchyo,項目名稱:pim-community-dev,代碼行數:15,代碼來源:CompletenessController.php

示例2: let

 function let(DocumentManager $manager, ChannelInterface $ecommerce, ChannelInterface $mobile, LocaleInterface $enUs, LocaleInterface $frFr, CategoryInterface $category, ChannelManager $channelManager, CategoryRepositoryInterface $categoryRepository, ProductRepository $productRepository, QueryBuilder $ormQb, Builder $odmQb, Query $odmQuery, Cursor $cursor)
 {
     $enUs->getCode()->willReturn('en_US');
     $frFr->getCode()->willReturn('fr_FR');
     $ecommerce->getCode()->willReturn('ecommerce');
     $ecommerce->getLabel()->willReturn('ECommerce');
     $ecommerce->getLocales()->willReturn(array($enUs, $frFr));
     $ecommerce->getCategory()->willReturn($category);
     $mobile->getCode()->willReturn('mobile');
     $mobile->getLabel()->willReturn('Mobile');
     $mobile->getLocales()->willReturn(array($enUs));
     $mobile->getCategory()->willReturn($category);
     $odmQuery->execute()->willReturn($cursor);
     $productRepository->createQueryBuilder()->willReturn($odmQb);
     $odmQb->hydrate(Argument::any())->willReturn($odmQb);
     $odmQb->field(Argument::any())->willReturn($odmQb);
     $odmQb->in(Argument::any())->willReturn($odmQb);
     $odmQb->equals(Argument::any())->willReturn($odmQb);
     $odmQb->select('_id')->willReturn($odmQb);
     $odmQb->getQuery()->willReturn($odmQuery);
     $categoryRepository->getAllChildrenQueryBuilder($category, true)->willReturn($ormQb);
     $categoryRepository->getCategoryIds($category, $ormQb)->willReturn(array(1, 2, 3));
     $channelManager->getFullChannels()->willReturn(array($ecommerce, $mobile));
     $manager->getRepository('pim_product_class')->willReturn($productRepository);
     $this->beConstructedWith($manager, $channelManager, $categoryRepository, 'pim_product_class');
 }
開發者ID:abdeldayem,項目名稱:pim-community-dev,代碼行數:26,代碼來源:CompletenessRepositorySpec.php

示例3: getCompleteProductsCountPerChannels

 /**
  * {@inheritdoc}
  */
 public function getCompleteProductsCountPerChannels()
 {
     $channels = $this->channelManager->getFullChannels();
     $productRepo = $this->documentManager->getRepository($this->productClass);
     $productsCount = array();
     foreach ($channels as $channel) {
         $category = $channel->getCategory();
         $categoryQb = $this->categoryRepository->getAllChildrenQueryBuilder($category, true);
         $categoryIds = $this->categoryRepository->getCategoryIds($category, $categoryQb);
         foreach ($channel->getLocales() as $locale) {
             $data = array();
             $compSuffix = $channel->getCode() . '-' . $locale->getCode();
             $qb = $productRepo->createQueryBuilder()->hydrate(false)->field('categoryIds')->in($categoryIds)->field('enabled')->equals(true)->field('normalizedData.completenesses.' . $compSuffix)->equals(100)->select('_id');
             $localeCount = $qb->getQuery()->execute()->count();
             $data['locale'] = $locale->getCode();
             $data['label'] = $channel->getLabel();
             $data['total'] = $localeCount;
             $productsCount[] = $data;
         }
     }
     return $productsCount;
 }
開發者ID:jacko972,項目名稱:pim-community-dev,代碼行數:25,代碼來源:CompletenessRepository.php

示例4: getChannelLocaleCombinations

 /**
  * Generate a list of potential completeness value from existing channel
  * or from the provided channel
  *
  * @param Channel $channel
  *
  * @return array
  */
 protected function getChannelLocaleCombinations(Channel $channel = null)
 {
     $channels = array();
     $combinations = array();
     if (null !== $channel) {
         $channels = [$channel];
     } else {
         $channels = $this->channelManager->getFullChannels();
     }
     foreach ($channels as $channel) {
         $locales = $channel->getLocales();
         foreach ($locales as $locale) {
             $combinations[] = $channel->getCode() . '-' . $locale->getCode();
         }
     }
     return $combinations;
 }
開發者ID:javiersantos,項目名稱:pim-community-dev,代碼行數:25,代碼來源:CompletenessGenerator.php


注:本文中的Pim\Bundle\CatalogBundle\Manager\ChannelManager::getFullChannels方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。