Advertisement
r1pp3rj4ck

AcmeDemoBundle:UserAdmin

May 11th, 2012
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. public function getBatchActions()
  2. {
  3.     $groups = $this->getModelManager()->createQuery('Acme\DemoBundle\Entity\Group', 'g')->execute();
  4.     $groupsArray = array();
  5.     foreach ($groups as $group)
  6.     {
  7.         $groupsArray[$group->getId()] = $group->getTitle();
  8.     }
  9.     $actions = parent::getBatchActions();
  10.  
  11.     $actions['addToGroup'] = array(
  12.         'label'            => $this->trans('action_add_to_group', array(), 'SonataAdminBundle'),
  13.         'ask_confirmation' => true,
  14.         'secondary'        => $groupsArray,
  15.     );
  16.  
  17.     return $actions;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement