本文整理匯總了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;
}
示例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);
}
示例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();
}
}
示例4: configureCatalogContext
/**
* Define locale and scope in CatalogContext
*/
protected function configureCatalogContext()
{
$this->catalogContext->setLocaleCode($this->userContext->getCurrentLocaleCode());
$this->catalogContext->setScopeCode($this->userContext->getUserChannelCode());
}