feature #440 Fix 439: Use dispatch method in tweaked actions (thomasbeaujean)
feature #440 Fix 439: Use dispatch method in tweaked actions (thomasbeaujean)

This PR was squashed before being merged into the master branch (closes #440).

Discussion
----------

Fix 439: Use dispatch method in tweaked actions

Use case:
I wan to tweak the controller using listMyEntityAction.
So this action will looks like the original listAction:

    /**
     * The method that is executed when the user performs a 'list' action on an entity.
     *
     * @return Response
     */
    protected function listAction()
    {
        $this->dispatch(EasyAdminEvents::PRE_LIST);

        $fields = $this->entity['list']['fields'];
        $paginator = $this->findAll($this->entity['class'], $this->request->query->get('page', 1), $this->config['list']['max_results'], $this->request->query->get('sortField'), $this->request->query->get('sortDirection'));

        $this->dispatch(EasyAdminEvents::POST_LIST, array('paginator' => $paginator));

        return $this->render($this->entity['templates']['list'], array(
            'paginator' => $paginator,
            'fields'    => $fields,
        ));
    }

I do not want to break the behaviour of the bundle, so the dispatch needs to be sent.

As my controller extends the original AdminController, the dispatch method is private and I need to copy/paste this one.

So the dispatch method should be protected to avoid useless copy/paste

Commits
-------

9d3166a Fix 439: Use dispatch method in tweaked actions

javiereguiluz/EasyAdminBundle,ogizanagi/EasyAdminBundle,datagit/EasyAdminBundle,seydu/EasyAdminBundle,OskarStark/EasyAdminBundle,gabiudrescu/EasyAdminBundle,kamilZ/EasyAdminBundle,seydu/EasyAdminBundle,thomasbeaujean/EasyAdminBundle,thomasbeaujean/EasyAdminBundle,ogizanagi/EasyAdminBundle,kamilZ/EasyAdminBundle,yceruto/EasyAdminBundle,OskarStark/EasyAdminBundle,alexgt9/EasyAdminBundle,gabiudrescu/EasyAdminBundle,kamilZ/EasyAdminBundle,alexgt9/EasyAdminBundle,alexgt9/EasyAdminBundle,seydu/EasyAdminBundle,javiereguiluz/EasyAdminBundle,gabiudrescu/EasyAdminBundle,yceruto/EasyAdminBundle,ogizanagi/EasyAdminBundle,yceruto/EasyAdminBundle,OskarStark/EasyAdminBundle,thomasbeaujean/EasyAdminBundle,datagit/EasyAdminBundle,datagit/EasyAdminBundle,ogizanagi/EasyAdminBundle