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

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

Lists all PublisherThemes entities.
public indexAction ( integer $publisherId ) : Response
$publisherId integer
Результат Symfony\Component\HttpFoundation\Response
    public function indexAction($publisherId)
    {
        $em = $this->getDoctrine()->getManager();
        $publisher = $em->getRepository('OjsJournalBundle:Publisher')->find($publisherId);
        $this->throw404IfNotFound($publisher);
        if (!$this->isGrantedForPublisher($publisher)) {
            throw new AccessDeniedException("You are not authorized for this page!");
        }
        $source = new Entity('OjsJournalBundle:PublisherTheme');
        $alias = $source->getTableAlias();
        $source->manipulateQuery(function (QueryBuilder $qb) use($publisher, $alias) {
            $qb->andWhere($alias . '.publisher = :publisher')->setParameter('publisher', $publisher);
        });
        $grid = $this->get('grid')->setSource($source);
        $gridAction = $this->get('grid_action');
        $actionColumn = new ActionsColumn("actions", 'actions');
        $rowAction[] = $gridAction->showAction('ojs_publisher_manager_theme_show', ['publisherId' => $publisher->getId(), 'id']);
        $rowAction[] = $gridAction->editAction('ojs_publisher_manager_theme_edit', ['publisherId' => $publisher->getId(), 'id']);
        $rowAction[] = $gridAction->deleteAction('ojs_publisher_manager_theme_delete', ['publisherId' => $publisher->getId(), 'id']);
        $actionColumn->setRowActions($rowAction);
        $grid->addColumn($actionColumn);
        $data = [];
        $data['grid'] = $grid;
        $data['publisher'] = $publisher;
        return $grid->getGridResponse('OjsJournalBundle:ManagerPublisherTheme:index.html.twig', $data);
    }