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

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

Lists all JournalContact 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, 'contacts')) {
            throw new AccessDeniedException("You are not authorized for view this page!");
        }
        $source = new Entity('OjsJournalBundle:JournalContact');
        $grid = $this->get('grid');
        $grid->setSource($source);
        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction = [];
        $rowAction[] = $gridAction->showAction('ojs_journal_journal_contact_show', ['id', 'journalId' => $journal->getId()]);
        $rowAction[] = $gridAction->editAction('ojs_journal_journal_contact_edit', ['id', 'journalId' => $journal->getId()]);
        $rowAction[] = $gridAction->deleteAction('ojs_journal_journal_contact_delete', ['id', 'journalId' => $journal->getId()]);
        $actionColumn->setRowActions($rowAction);
        $grid->addColumn($actionColumn);
        $listEvent = new ListEvent();
        $listEvent->setGrid($grid);
        $eventDispatcher->dispatch(JournalContactEvents::LISTED, $listEvent);
        $grid = $listEvent->getGrid();
        return $grid->getGridResponse('OjsJournalBundle:JournalContact:index.html.twig');
    }