本文整理汇总了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());
}