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


PHP UserContext::getUserChannelCode方法代碼示例

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


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

示例1: apply

 /**
  * {@inheritdoc}
  */
 public function apply(FilterDatasourceAdapterInterface $ds, $data)
 {
     $channelCode = $this->parseData($data);
     if (!$channelCode) {
         $channelCode = $this->userContext->getUserChannelCode();
     }
     $this->catalogContext->setScopeCode($channelCode);
     return true;
 }
開發者ID:ashutosh-srijan,項目名稱:findit_akeneo,代碼行數:12,代碼來源:ScopeFilter.php

示例2: let

 function let(SecurityContextInterface $securityContext, AddLocaleListener $listener, CatalogContext $catalogContext, UserContext $userContext, GetResponseEvent $event)
 {
     $securityContext->getToken()->willReturn(true);
     $event->getRequestType()->willReturn(HttpKernel::MASTER_REQUEST);
     $userContext->getCurrentLocaleCode()->willReturn('de_DE');
     $userContext->getUserChannelCode()->willReturn('schmetterling');
     $this->beConstructedWith($securityContext, $listener, $catalogContext, $userContext);
 }
開發者ID:javiersantos,項目名稱:pim-community-dev,代碼行數:8,代碼來源:UserContextListenerSpec.php

示例3: getScope

 /**
  * Get scope from datagrid's filters, fallback on request parameters to deal with the mass edit case
  *
  * @return string
  */
 protected function getScope()
 {
     $filterValues = $this->requestParams->get('_filter');
     if (empty($filterValues)) {
         $filterValues = $this->request->get('filters');
     }
     if (isset($filterValues['scope']['value']) && $filterValues['scope']['value'] !== null) {
         return $filterValues['scope']['value'];
     } else {
         return $this->userContext->getUserChannelCode();
     }
 }
開發者ID:javiersantos,項目名稱:pim-community-dev,代碼行數:17,代碼來源:AddParametersToProductGridListener.php

示例4: configureCatalogContext

 /**
  * Define locale and scope in CatalogContext
  */
 protected function configureCatalogContext()
 {
     $this->catalogContext->setLocaleCode($this->userContext->getCurrentLocaleCode());
     $this->catalogContext->setScopeCode($this->userContext->getUserChannelCode());
 }
開發者ID:SamirBoulil,項目名稱:pim-community-dev,代碼行數:8,代碼來源:UserContextListener.php


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