diff --git a/Admin/Admin.php b/Admin/Admin.php index b63b2a96032..c7dcef4b3d0 100644 --- a/Admin/Admin.php +++ b/Admin/Admin.php @@ -853,7 +853,7 @@ public function getFilterParameters() /** * {@inheritdoc} */ - public function buildDatagrid() + public function buildDatagrid($context = 'list') { if ($this->datagrid) { return; @@ -877,7 +877,7 @@ public function buildDatagrid() } // initialize the datagrid - $this->datagrid = $this->getDatagridBuilder()->getBaseDatagrid($this, $filterParameters); + $this->datagrid = $this->getDatagridBuilder()->getBaseDatagrid($this, $filterParameters, $context); $this->datagrid->getPager()->setMaxPageLinks($this->maxPageLinks); @@ -1447,9 +1447,9 @@ public function createQuery($context = 'list') /** * {@inheritdoc} */ - public function getDatagrid() + public function getDatagrid($context = 'list') { - $this->buildDatagrid(); + $this->buildDatagrid($context); return $this->datagrid; } diff --git a/Admin/AdminInterface.php b/Admin/AdminInterface.php index 72fd2aa7689..312f24c4c21 100644 --- a/Admin/AdminInterface.php +++ b/Admin/AdminInterface.php @@ -16,6 +16,7 @@ use Sonata\AdminBundle\Builder\FormContractorInterface; use Sonata\AdminBundle\Builder\ListBuilderInterface; use Sonata\AdminBundle\Builder\RouteBuilderInterface; +use Sonata\AdminBundle\Datagrid\DatagridInterface; use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; use Sonata\AdminBundle\Route\RouteGeneratorInterface; use Sonata\AdminBundle\Security\Handler\SecurityHandlerInterface; @@ -112,9 +113,11 @@ public function getClass(); public function attachAdminClass(FieldDescriptionInterface $fieldDescription); /** - * @return \Sonata\AdminBundle\Datagrid\DatagridInterface + * @param string $context + * + * @return DatagridInterface */ - public function getDatagrid(); + public function getDatagrid($context = 'list'); /** * Set base controller name.