本文整理汇总了PHP中Sonata\AdminBundle\Admin\Admin::getPersistentParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::getPersistentParameters方法的具体用法?PHP Admin::getPersistentParameters怎么用?PHP Admin::getPersistentParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sonata\AdminBundle\Admin\Admin
的用法示例。
在下文中一共展示了Admin::getPersistentParameters方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPersistentParameters
/**
* {@inheritdoc}
*/
public function getPersistentParameters()
{
$parameters = parent::getPersistentParameters();
if (!$this->hasRequest()) {
return $parameters;
}
$filter = $this->getRequest()->get('filter');
if ($filter && array_key_exists('context', $this->getRequest()->get('filter'))) {
$context = $filter['context']['value'];
} else {
$context = $this->getRequest()->get('context', $this->pool->getDefaultContext());
}
$providers = $this->pool->getProvidersByContext($context);
$provider = $this->getRequest()->get('provider');
// if the context has only one provider, set it into the request
// so the intermediate provider selection is skipped
if (count($providers) == 1 && null === $provider) {
$provider = array_shift($providers)->getName();
$this->getRequest()->query->set('provider', $provider);
}
$categoryId = $this->getRequest()->get('category');
if (!$categoryId) {
$categoryId = $this->categoryManager->getRootCategory($context)->getId();
}
return array_merge($parameters, array('context' => $context, 'category' => $categoryId, 'hide_context' => (bool) $this->getRequest()->get('hide_context')));
}
示例2: getPersistentParameters
/**
* {@inheritdoc}
*/
public function getPersistentParameters()
{
$parameters = parent::getPersistentParameters();
if (!$this->hasRequest()) {
return $parameters;
}
return array_merge($parameters, array('context' => $this->getRequest()->get('context', $this->pool->getDefaultContext())));
}
示例3: getPersistentParameters
/**
* {@inheritdoc}
*/
public function getPersistentParameters()
{
$parameters = parent::getPersistentParameters();
if (!$this->hasRequest()) {
return $parameters;
}
$context = $this->getRequest()->get('context');
return array_merge($parameters, array('context' => $context, 'hide_context' => (bool) $this->getRequest()->get('hide_context')));
}
示例4: getPersistentParameters
/**
* {@inheritdoc}
*/
public function getPersistentParameters()
{
if (!$this->hasRequest()) {
return array();
}
$parameters = parent::getPersistentParameters();
if ($composer = $this->getRequest()->get('composer')) {
$parameters['composer'] = $composer;
}
if ($composer = $this->getRequest()->get('type')) {
$parameters['type'] = $composer;
}
return $parameters;
}
示例5: getPersistentParameters
/**
* @inheritDoc
*/
public function getPersistentParameters()
{
$parameters = parent::getPersistentParameters();
$parameters['route_type'] = $this->getRequest()->get('route_type');
return $parameters;
}