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


PHP ChannelManager::getChannels方法代码示例

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


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

示例1: finishView

 /**
  * {@inheritdoc}
  */
 public function finishView(FormView $view, FormInterface $form, array $options)
 {
     $values = null !== $view->vars['value'] ? $view->vars['value']->getValues() : [];
     $view->vars['groups'] = $this->productFormView->getView();
     $view->vars['orderedGroups'] = $this->getOrderedGroups($values);
     $view->vars['locales'] = $this->userContext->getUserLocales();
     $view->vars['channels'] = $this->channelManager->getChannels();
     $view->vars['currentLocale'] = $options['currentLocale'];
 }
开发者ID:abdeldayem,项目名称:pim-community-dev,代码行数:12,代码来源:ProductTemplateType.php

示例2: editAction

 /**
  * Edit a family
  *
  * TODO : find a way to use param converter with interfaces
  *
  * @param Family $family
  *
  * @Template
  * @AclAncestor("pim_enrich_family_index")
  *
  * @return array
  */
 public function editAction(Family $family)
 {
     if ($this->familyHandler->process($family)) {
         $this->addFlash('success', 'flash.family.updated');
     }
     return ['form' => $this->familyForm->createView(), 'attributesForm' => $this->getAvailableAttributesForm($family->getAttributes()->toArray())->createView(), 'channels' => $this->channelManager->getChannels()];
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:19,代码来源:FamilyController.php

示例3: testGetChannels

 /**
  * Test related method
  */
 public function testGetChannels()
 {
     $channels = $this->manager->getChannels();
     $this->assertCount(2, $channels);
     $this->assertEquals($this->channel1, reset($channels));
     $this->assertEquals($this->channel2, end($channels));
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:10,代码来源:ChannelManagerTest.php

示例4: editAction

 /**
  * Edit a family
  *
  * @param int $id
  *
  * @Template
  * @AclAncestor("pim_enrich_family_index")
  *
  * @return array
  */
 public function editAction($id)
 {
     $family = $this->familyRepository->find($id);
     if (null === $family) {
         throw new NotFoundHttpException(sprintf('%s entity not found', $this->familyClass));
     }
     if ($this->familyHandler->process($family)) {
         $this->request->getSession()->getFlashBag()->add('success', new Message('flash.family.updated'));
     }
     return ['form' => $this->familyForm->createView(), 'attributesForm' => $this->getAvailableAttributesForm($family->getAttributes()->toArray())->createView(), 'channels' => $this->channelManager->getChannels()];
 }
开发者ID:userz58,项目名称:pim-community-dev,代码行数:21,代码来源:FamilyController.php

示例5: getScopeToLocaleRows

 /**
  * Return rows for available channels and theirs locales
  *
  * @param AbstractAttribute $attribute
  *
  * @return array
  */
 protected function getScopeToLocaleRows(AbstractAttribute $attribute)
 {
     $channels = $this->channelManager->getChannels();
     $scopeToLocaleRows = array();
     foreach ($channels as $channel) {
         foreach ($channel->getLocales() as $locale) {
             $scopeToLocaleRows[] = array('attribute' => $attribute->getCode(), 'locale' => $locale->getCode(), 'scope' => $channel->getCode());
         }
     }
     return $scopeToLocaleRows;
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:18,代码来源:ProductBuilder.php

示例6: let

 function let(SecurityContextInterface $securityContext, LocaleManager $localeManager, ChannelManager $channelManager, CategoryManager $categoryManager, TokenInterface $token, User $user, LocaleInterface $en, LocaleInterface $fr, LocaleInterface $de, ChannelInterface $ecommerce, ChannelInterface $mobile, CategoryInterface $firstTree, CategoryInterface $secondTree)
 {
     $securityContext->getToken()->willReturn($token);
     $token->getUser()->willReturn($user);
     $en->getCode()->willReturn('en_US');
     $fr->getCode()->willReturn('fr_FR');
     $de->getCode()->willReturn('de_DE');
     $en->isActivated()->willReturn(true);
     $fr->isActivated()->willReturn(true);
     $de->isActivated()->willReturn(true);
     $localeManager->getLocaleByCode('en_US')->willReturn($en);
     $localeManager->getLocaleByCode('fr_FR')->willReturn($fr);
     $localeManager->getLocaleByCode('de_DE')->willReturn($de);
     $localeManager->getActiveLocales()->willReturn([$en, $fr, $de]);
     $channelManager->getChannels()->willReturn([$mobile, $ecommerce]);
     $categoryManager->getTrees()->willReturn([$firstTree, $secondTree]);
     $this->beConstructedWith($securityContext, $localeManager, $channelManager, $categoryManager, 'en_US');
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:18,代码来源:UserContextSpec.php

示例7: __construct

 /**
  * @param ChannelManager $channelManager
  */
 public function __construct(ChannelManager $channelManager)
 {
     $this->channels = $channelManager->getChannels();
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:7,代码来源:AddAttributeRequirementsSubscriber.php

示例8: getUserChannel

 /**
  * Get user channel
  *
  * @return Channel
  */
 public function getUserChannel()
 {
     $catalogScope = $this->getUserOption('catalogScope');
     return $catalogScope ?: current($this->channelManager->getChannels());
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:10,代码来源:UserContext.php

示例9: getChannels

 /**
  * Get the PIM channels
  *
  * @return \Pim\Bundle\CatalogBundle\Entity\Channel[]
  */
 protected function getChannels()
 {
     return $this->channelManager->getChannels();
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:9,代码来源:FamilyFactory.php


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