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

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

Lists all Citation entities.
public indexAction ( Request $request, integer $articleId ) : Response
$request Symfony\Component\HttpFoundation\Request
$articleId integer
Результат Symfony\Component\HttpFoundation\Response
    public function indexAction(Request $request, $articleId)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        $this->throw404IfNotFound($journal);
        if (!$this->isGranted('VIEW', $journal, 'articles')) {
            throw new AccessDeniedException("You not authorized for this page!");
        }
        $article = $this->getDoctrine()->getRepository('OjsJournalBundle:Article')->find($articleId);
        $this->throw404IfNotFound($article);
        $source = new Entity('OjsJournalBundle:Citation');
        if ($articleId !== null) {
            $alias = $source->getTableAlias();
            $source->manipulateQuery(function (QueryBuilder $query) use($alias, $articleId) {
                $query->join($alias . '.articles', 'a')->where('a.id = :articleId')->setParameter('articleId', $articleId);
            });
        }
        $grid = $this->get('grid')->setSource($source);
        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction[] = $gridAction->showAction('ojs_journal_citation_show', ['id', 'journalId' => $journal->getId(), 'articleId' => $articleId]);
        $rowAction[] = $gridAction->editAction('ojs_journal_citation_edit', ['id', 'journalId' => $journal->getId(), 'articleId' => $articleId]);
        $rowAction[] = $gridAction->deleteAction('ojs_journal_citation_delete', ['id', 'journalId' => $journal->getId(), 'articleId' => $articleId]);
        $actionColumn->setRowActions($rowAction);
        $grid->addColumn($actionColumn);
        return $grid->getGridResponse('OjsJournalBundle:Citation:index.html.twig');
    }