Ojs\JournalBundle\Controller\JournalPostController::indexAction PHP Метод

indexAction() публичный Метод

Lists all JournalPost entities.
public indexAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
Результат Symfony\Component\HttpFoundation\Response
    public function indexAction(Request $request)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        $eventDispatcher = $this->get('event_dispatcher');
        if (!$this->isGranted('VIEW', $journal, 'posts')) {
            throw new AccessDeniedException("You are not authorized for this post!");
        }
        $source = new Entity('OjsJournalBundle:JournalPost');
        $grid = $this->get('grid')->setSource($source);
        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction[] = $gridAction->showAction('ojs_journal_post_show', ['id', 'journalId' => $journal->getId()]);
        $rowAction[] = $gridAction->editAction('ojs_journal_post_edit', ['id', 'journalId' => $journal->getId()]);
        $rowAction[] = $gridAction->deleteAction('ojs_journal_post_delete', ['id', 'journalId' => $journal->getId()]);
        $actionColumn->setRowActions($rowAction);
        $grid->addColumn($actionColumn);
        $listEvent = new ListEvent();
        $listEvent->setGrid($grid);
        $eventDispatcher->dispatch(JournalPostEvents::LISTED, $listEvent);
        $grid = $listEvent->getGrid();
        return $grid->getGridResponse('OjsJournalBundle:JournalPost:index.html.twig');
    }