本文整理汇总了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'];
}
示例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()];
}
示例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));
}
示例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()];
}
示例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;
}
示例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');
}
示例7: __construct
/**
* @param ChannelManager $channelManager
*/
public function __construct(ChannelManager $channelManager)
{
$this->channels = $channelManager->getChannels();
}
示例8: getUserChannel
/**
* Get user channel
*
* @return Channel
*/
public function getUserChannel()
{
$catalogScope = $this->getUserOption('catalogScope');
return $catalogScope ?: current($this->channelManager->getChannels());
}
示例9: getChannels
/**
* Get the PIM channels
*
* @return \Pim\Bundle\CatalogBundle\Entity\Channel[]
*/
protected function getChannels()
{
return $this->channelManager->getChannels();
}