Ojs\JournalBundle\Controller\BoardController::showAction PHP Метод

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

This page is also an arrangement page for a board. In this page journal manager can : - list members - add members to a board - change orders of the members
public showAction ( Board $board ) : Response
$board Ojs\JournalBundle\Entity\Board
Результат Symfony\Component\HttpFoundation\Response
    public function showAction(Board $board)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        if (!$this->isGranted('VIEW', $journal, 'boards')) {
            throw new AccessDeniedException("You not authorized for view this journal's boards!");
        }
        $boardMember = new BoardMember();
        $addMemberForm = $this->createAddMemberForm($boardMember, $board, $journal);
        $token = $this->get('security.csrf.token_manager')->refreshToken('ojs_journal_board' . $board->getId());
        $source = new Entity('OjsJournalBundle:BoardMember');
        $alias = $source->getTableAlias();
        $source->manipulateQuery(function (QueryBuilder $query) use($alias, $board) {
            $query->andWhere($alias . '.board = :board')->setParameter('board', $board);
        });
        $membersGrid = $this->get('grid')->setSource($source);
        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction = [];
        if ($this->isGranted('EDIT', $journal, 'boards')) {
            $rowAction[] = $gridAction->deleteAction('ojs_journal_board_member_remove', ['id', 'journalId' => $journal->getId(), 'boardId' => $board->getId()]);
        }
        $actionColumn->setRowActions($rowAction);
        $membersGrid->addColumn($actionColumn);
        return $membersGrid->getGridResponse('OjsJournalBundle:Board:show.html.twig', array('membersGrid' => $membersGrid, 'entity' => $board, 'token' => $token, 'addMemberForm' => $addMemberForm->createView()));
    }