Exemplo n.º 1
0
 /**
  * Lists all EventLogs
  *
  * @return mixed
  */
 public function indexAction()
 {
     $logTypes = EventLogParams::adminLevelEventLogs();
     $source = new Entity('OjsUserBundle:EventLog');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($tableAlias, $logTypes) {
         $expression = $qb->expr()->in($tableAlias . '.eventInfo', ':logTypes');
         $qb->andWhere($expression)->setParameters(['logTypes' => $logTypes]);
         return $qb;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", "actions");
     $actionColumn->setRowActions([$gridAction->showAction('ojs_admin_event_log_show', 'id')]);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsAdminBundle:AdminEventLog:index.html.twig', ['grid' => $grid]);
 }