本文整理匯總了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;
}