當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Entity::addHint方法代碼示例

本文整理匯總了PHP中APY\DataGridBundle\Grid\Source\Entity::addHint方法的典型用法代碼示例。如果您正苦於以下問題:PHP Entity::addHint方法的具體用法?PHP Entity::addHint怎麽用?PHP Entity::addHint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在APY\DataGridBundle\Grid\Source\Entity的用法示例。


在下文中一共展示了Entity::addHint方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: institutionIndexAction

 /**
  * Lists all Institution entities.
  *
  */
 public function institutionIndexAction()
 {
     $data = array();
     $source = new Entity('OjsJournalBundle:Institution', 'application');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $query) use($tableAlias) {
         $query->andWhere($tableAlias . ".status = :status")->setParameter('status', 0);
         return $query;
     });
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $grid->getColumn('status')->manipulateRenderCell(function ($value, $row, $router) {
         return $this->get('translator')->trans(CommonParams::institutionStatus($row->getField('status')));
     });
     $rowAction = array();
     $rowAction[] = $gridAction->editAction('ojs_admin_application_institution_edit', 'id');
     $rowAction[] = $gridAction->showAction('ojs_admin_application_institution_show', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_application_institution_delete', 'id');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsAdminBundle:AdminApplication:institution.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:29,代碼來源:AdminApplicationController.php

示例2: notFinishedAction

 /**
  * Returns setupStatus == false journals
  * @return Response
  */
 public function notFinishedAction()
 {
     if (!$this->isGranted('VIEW', new Journal())) {
         throw new AccessDeniedException("You not authorized for list journals!");
     }
     $source = new Entity('OjsJournalBundle:Journal');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function ($query) use($tableAlias) {
         $query->andWhere($tableAlias . '.setup_status = 0');
     });
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_admin_journal_show', 'id');
     $rowAction[] = $gridAction->editAction('ojs_admin_journal_edit', 'id');
     $rowAction[] = $gridAction->cmsAction();
     $rowAction[] = $gridAction->deleteAction('ojs_admin_journal_delete', 'id');
     $rowAction[] = (new RowAction('Manage', 'change_selected_journal'))->setRouteParameters('id')->setRouteParametersMapping(array('id' => 'journal_id'))->setAttributes(array('class' => 'btn btn-success btn-xs', 'data-toggle' => 'tooltip', 'title' => "Manage"));
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsAdminBundle:AdminJournal:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:29,代碼來源:AdminJournalController.php

示例3: indexAction

 /**
  * Lists all Subject entities.
  *
  */
 public function indexAction()
 {
     if (!$this->isGranted('VIEW', new Subject())) {
         throw new AccessDeniedException("You are not authorized for this page!");
     }
     $source = new Entity("OjsJournalBundle:Subject");
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_admin_subject_show', 'id');
     $rowAction[] = $gridAction->editAction('ojs_admin_subject_edit', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_subject_delete', 'id');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     /** @var SubjectRepository $repo */
     $repo = $this->getDoctrine()->getRepository('OjsJournalBundle:Subject');
     $options = array('decorate' => true, 'rootOpen' => '<ul>', 'rootClose' => '</ul>', 'childOpen' => '<li>', 'childClose' => '</li>', 'idField' => true, 'nodeDecorator' => function ($node) {
         return '<a href="' . $this->generateUrl('ojs_admin_subject_show', array('id' => $node['id'])) . '">' . $node['subject'] . '</a>';
     });
     $data['htmlTree'] = $repo->childrenHierarchy(null, false, $options);
     return $grid->getGridResponse('OjsAdminBundle:AdminSubject:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:29,代碼來源:AdminSubjectController.php

示例4: indexAction

 public function indexAction(Request $request, $issueId)
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     $this->throw404IfNotFound($journal);
     if (!$this->isGranted('VIEW', $journal, 'issues')) {
         throw new AccessDeniedException("You not authorized for this page!");
     }
     $source = new Entity('OjsJournalBundle:IssueFile');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $issue = $this->getDoctrine()->getRepository('OjsJournalBundle:Issue')->find($issueId);
     $this->throw404IfNotFound($issue);
     $alias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $query) use($alias, $issueId) {
         $query->join($alias . '.issue', 'i')->where('i.id = :issueId')->setParameter('issueId', $issueId);
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_issue_file_show', ['id', 'journalId' => $journal->getId(), 'issueId' => $issueId]);
     $rowAction[] = $gridAction->editAction('ojs_journal_issue_file_edit', ['id', 'journalId' => $journal->getId(), 'issueId' => $issueId]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_issue_file_delete', ['id', 'journalId' => $journal->getId(), 'issueId' => $issueId]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     $data['issue'] = $issue;
     return $grid->getGridResponse('OjsJournalBundle:IssueFile:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:28,代碼來源:IssueFileController.php

示例5: indexAction

 /**
  * Lists all JournalSection entities.
  *
  */
 public function indexAction()
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'sections')) {
         throw new AccessDeniedException("You are not authorized for view this journal's sections!");
     }
     $source = new Entity('OjsJournalBundle:JournalSection');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $ta = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($journal, $ta) {
         $qb->where($qb->expr()->eq($ta . '.journalId', $journal->getId()));
         return $qb;
     });
     $source->manipulateRow(function (Row $row) {
         if ($row->getField("title") && strlen($row->getField('title')) > 20) {
             $row->setField('title', substr($row->getField('title'), 0, 20) . "...");
         }
         return $row;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_section_show', ['id', 'journalId' => $journal->getId()]);
     if ($this->isGranted('EDIT', $this->get('ojs.journal_service')->getSelectedJournal(), 'sections')) {
         $rowAction[] = $gridAction->editAction('ojs_journal_section_edit', ['id', 'journalId' => $journal->getId()]);
     }
     if ($this->isGranted('DELETE', $this->get('ojs.journal_service')->getSelectedJournal(), 'sections')) {
         $rowAction[] = $gridAction->deleteAction('ojs_journal_section_delete', ['id', 'journalId' => $journal->getId()]);
     }
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsJournalBundle:JournalSection:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:39,代碼來源:JournalSectionController.php

示例6: indexAction

 /**
  * @Template()
  * @Route("/", name="ticket.ticket.index")
  * @Security("has_role('ROLE_USER')")
  * @param Request $request
  * @return array
  */
 public function indexAction(Request $request)
 {
     $user = $this->getUser();
     $source = new Entity('DreamlexTicketBundle:Ticket');
     $source->addHint(\Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $prefixTitle = 'ticket.label.grid.';
     $translator = $this->get('translator');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function ($query) use($tableAlias, $user) {
         /** @var QueryBuilder $query */
         $query->andWhere($tableAlias . '.user = :user')->setParameter('user', $user);
     });
     $source->manipulateRow(function ($row) use($user) {
         /** @var Row $row */
         if ($row->getField('lastUser.id') != $user->getId() && !$row->getField('isRead')) {
             $row->setClass('warning');
         }
         return $row;
     });
     $grid = $this->get('grid');
     $grid->setSource($source);
     $grid->setLimits(10);
     $grid->setPrefixTitle($prefixTitle);
     $grid->setId('ticket');
     $grid->setNoDataMessage($translator->trans('ticket.message.no_tickets'));
     $replyAction = new RowAction('ticket.button.reply', 'ticket.ticket.show', false, '_self', ['class' => 'btn btn-success', 'icon' => 'fa fa-reply']);
     $grid->addRowAction($replyAction);
     $grid->isReadyForRedirect();
     return $grid->getGridResponse();
 }
開發者ID:dreamlex,項目名稱:ticketbundle,代碼行數:37,代碼來源:TicketController.php

示例7: indexAction

 /**
  * Lists all SubmissionChecklist entities.
  *
  */
 public function indexAction()
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'checklist')) {
         throw new AccessDeniedException("You are not authorized for view this page!");
     }
     $source = new Entity('OjsJournalBundle:SubmissionChecklist');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     if ($journal) {
         $ta = $source->getTableAlias();
         $source->manipulateQuery(function (QueryBuilder $qb) use($journal, $ta) {
             $qb->andWhere($qb->expr()->eq("{$ta}.journal_id", ':journal'))->setParameter('journal', $journal->getId());
         });
     }
     if (!$journal) {
         throw new NotFoundHttpException("Journal not found!");
     }
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_checklist_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_checklist_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_checklist_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     $data['journal_id'] = $journal;
     return $grid->getGridResponse('OjsJournalBundle:SubmissionChecklist:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:34,代碼來源:SubmissionChecklistController.php

示例8: indexAction

 /**
  * Lists all Proxy entities.
  */
 public function indexAction()
 {
     if (!$this->isGranted('VIEW', new Proxy())) {
         throw new AccessDeniedException("You are not authorized for this page!");
     }
     $source = new Entity('OjsUserBundle:Proxy');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", "actions");
     $rowAction[] = $gridAction->showAction('ojs_admin_proxy_show', 'id');
     $rowAction[] = $gridAction->editAction('ojs_admin_proxy_edit', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_proxy_delete', 'id');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsAdminBundle:AdminProxy:index.html.twig', ['grid' => $grid]);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:20,代碼來源:AdminProxyController.php

示例9: indexAction

 /**
  * Lists all EventLogs
  *
  * @return mixed
  */
 public function indexAction()
 {
     $logTypes = EventLogParams::adminLevelEventLogs();
     $source = new Entity('OjsUserBundle:EventLog');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($tableAlias, $logTypes) {
         $expression = $qb->expr()->in($tableAlias . '.eventInfo', ':logTypes');
         $qb->andWhere($expression)->setParameters(['logTypes' => $logTypes]);
         return $qb;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", "actions");
     $actionColumn->setRowActions([$gridAction->showAction('ojs_admin_event_log_show', 'id')]);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsAdminBundle:AdminEventLog:index.html.twig', ['grid' => $grid]);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:23,代碼來源:AdminEventLogController.php

示例10: indexAction

 /**
  * Lists all MailTemplate entities.
  *
  * @return Response
  */
 public function indexAction()
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'mailTemplate')) {
         throw new AccessDeniedException("You are not authorized for view this page!");
     }
     $source = new Entity('OjsJournalBundle:MailTemplate');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $source->manipulateRow(function (Row $row) {
         if ($row->getField("title") && strlen($row->getField('title')) > 20) {
             $row->setField('title', substr($row->getField('title'), 0, 20) . "...");
         }
         return $row;
     });
     $ta = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($journal, $ta) {
         return $qb->andWhere($ta . '.journal = :journal')->setParameter('journal', $journal);
     });
     $grid = $this->get('grid.manager');
     $gridAction = $this->get('grid_action');
     $db_templates = $grid->createGrid('db_templates');
     $db_templates->setSource($source);
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction = [];
     $rowAction[] = $gridAction->showAction('ojs_journal_mail_template_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_mail_template_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_mail_template_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $db_templates->addColumn($actionColumn);
     $data = [];
     $data['db_templates'] = $db_templates;
     $yamlParser = new Parser();
     $defaultTemplates = $yamlParser->parse(file_get_contents($this->container->getParameter('kernel.root_dir') . '/../src/Ojs/JournalBundle/Resources/data/mailtemplates.yml'));
     $source = new Vector($defaultTemplates, [new NumberColumn(['id' => 'id', 'field' => 'id', 'title' => 'ID', 'source' => true]), new TextColumn(['id' => 'subject', 'field' => 'subject', 'title' => 'mailtemplate.subject', 'source' => true]), new TextColumn(['id' => 'lang', 'field' => 'lang', 'title' => 'mailtemplate.language', 'source' => true]), new TextColumn(['id' => 'type', 'field' => 'type', 'title' => 'mailtemplate.title', 'source' => true]), new TextColumn(['id' => 'template', 'field' => 'template', 'title' => 'mailtemplate.template', 'source' => true, 'visible' => false])]);
     $defaultTemplates = $grid->createGrid('default_templates');
     $defaultTemplates->setSource($source);
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction = [];
     $rowAction[] = $gridAction->copyAction('ojs_journal_mail_template_copy', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $defaultTemplates->addColumn($actionColumn);
     $data['default_templates'] = $defaultTemplates;
     return $grid->getGridManagerResponse('OjsJournalBundle:MailTemplate:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:49,代碼來源:MailTemplateController.php

示例11: indexAction

 /**
  * Lists all InstitutionTypes entities.
  *
  */
 public function indexAction()
 {
     if (!$this->isGranted('VIEW', new InstitutionTypes())) {
         throw new AccessDeniedException("You are not authorized for this page!");
     }
     $source = new Entity('OjsJournalBundle:InstitutionTypes');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_admin_institution_type_show', 'id');
     $rowAction[] = $gridAction->editAction('ojs_admin_institution_type_edit', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_institution_type_delete', 'id');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsAdminBundle:AdminInstitutionType:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:23,代碼來源:AdminInstitutionTypeController.php

示例12: indexAction

 /**
  * Lists all JournalTheme entities.
  *
  */
 public function indexAction()
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'theme')) {
         throw new AccessDeniedException("You are not authorized for view this page");
     }
     $source = new Entity('OjsJournalBundle:JournalTheme');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_theme_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_theme_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_theme_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsJournalBundle:JournalTheme:index.html.twig', $data);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:24,代碼來源:JournalThemeController.php

示例13: indexAction

 /**
  * Lists all EventLog according to user role.
  * @todo Add items to EventLogParams for every role
  *
  * @return mixed
  */
 public function indexAction()
 {
     /** @var User $user */
     $user = $this->getUser();
     $logTypes = EventLogParams::editorLevelEventLogs();
     $source = new Entity('OjsUserBundle:EventLog');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($tableAlias, $logTypes, $user) {
         $expression = $qb->expr()->in($tableAlias . '.eventInfo', ':logTypes');
         $qb->andWhere($expression)->setParameter('logTypes', $logTypes);
         $qb->andWhere("{$tableAlias}.userId = :userId OR {$tableAlias}.affectedUserId = :userId")->setParameter('userId', $user->getId());
         return $qb;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", "actions");
     $rowAction[] = $gridAction->showAction('user_eventlog_show', 'id');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsUserBundle:EventLog:index.html.twig', ['grid' => $grid]);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:28,代碼來源:EventLogController.php

示例14: indexAction

 /**
  * Lists all article entities for journal
  *
  * @return Response
  */
 public function indexAction()
 {
     $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!");
     }
     $source = new Entity('OjsJournalBundle:Article');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $alias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $query) use($alias, $journal) {
         $query->andWhere($alias . '.journal = :journal')->setParameter('journal', $journal);
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_article_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_article_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_article_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsJournalBundle:Article:index.html.twig', ['journal' => $journal]);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:28,代碼來源:ArticleController.php

示例15: indexAction

 /**
  * Finds and displays a Users of a Journal with roles
  * @return mixed
  */
 public function indexAction()
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'userRole')) {
         throw new AccessDeniedException("You are not authorized for view this page");
     }
     $source = new Entity('OjsJournalBundle:JournalUser');
     $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker');
     $alias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($journal, $alias) {
         $qb->andWhere($alias . '.journal = :journal')->setParameter('journal', $journal);
     });
     $grid = $this->get('grid');
     $grid->setSource($source);
     $gridAction = $this->get('grid_action');
     $rowAction = [];
     $rowAction[] = $gridAction->editAction('ojs_journal_user_edit', ['journalId' => $journal->getId(), 'id']);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_user_delete', ['journalId' => $journal->getId(), 'id']);
     $actionColumn = new ActionsColumn("actions", "actions");
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsJournalBundle:JournalUser:index.html.twig', $grid);
 }
開發者ID:necatikartal,項目名稱:ojs,代碼行數:27,代碼來源:JournalUserController.php


注:本文中的APY\DataGridBundle\Grid\Source\Entity::addHint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。