当前位置: 首页>>代码示例>>PHP>>正文


PHP Source\Entity类代码示例

本文整理汇总了PHP中APY\DataGridBundle\Grid\Source\Entity的典型用法代码示例。如果您正苦于以下问题:PHP Entity类的具体用法?PHP Entity怎么用?PHP Entity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Entity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction(Request $request)
 {
     $data = array();
     $source = new Entity('OjsJournalBundle:Journal');
     $source->manipulateRow(function (Row $row) use($request) {
         /* @var Journal $entity */
         $entity = $row->getEntity();
         $entity->setDefaultLocale($request->getDefaultLocale());
         if (!is_null($entity)) {
             $row->setField('title', $entity->getTitle());
         }
         return $row;
     });
     $alias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $query) use($alias) {
         $query->andWhere($alias . '.status = :status')->setParameter('status', '0');
         return $query;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $rowAction = array();
     $rowAction[] = $gridAction->editAction('ojs_admin_application_journal_edit', 'id');
     $rowAction[] = $gridAction->showAction('ojs_admin_application_journal_show', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_application_journal_delete', 'id');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsAdminBundle:AdminApplication:journal.html.twig', $data);
 }
开发者ID:hasantayyar,项目名称:ojs,代码行数:30,代码来源:AdminJournalApplicationController.php

示例2: indexAction

 /**
  * Finds and displays a Users of a Journal with roles
  *
  * @param Request $request
  * @return Response
  */
 public function indexAction(Request $request)
 {
     $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->manipulateRow(function (Row $row) use($request) {
         /* @var JournalUser $entity */
         $entity = $row->getEntity();
         if (!is_null($entity)) {
             $entity->getJournal()->setDefaultLocale($request->getDefaultLocale());
             if (!is_null($entity)) {
                 $row->setField('journal', $entity->getJournal()->getTitle());
             }
         }
         return $row;
     });
     $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:ulakjira,项目名称:ojs,代码行数:35,代码来源:JournalUserController.php

示例3: indexAction

 /**
  * @param Request $request
  * @return Response
  */
 public function indexAction(Request $request)
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'files')) {
         throw new AccessDeniedException("You are not authorized for this file!");
     }
     $router = $this->get('router');
     $source = new Entity('OjsJournalBundle:JournalFile');
     $source->manipulateRow(function (Row $row) use($request, $router) {
         /* @var JournalFile $entity */
         $entity = $row->getEntity();
         $pathLinkTemplate = '<a target="_blank" href="uploads/files/' . $entity->getPath() . '">' . $entity->getPath() . '</a>';
         $row->setField('path', $pathLinkTemplate);
         return $row;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_filemanager_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_filemanager_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_filemanager_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     return $grid->getGridResponse('OjsJournalBundle:JournalFile:index.html.twig', ['grid' => $grid]);
 }
开发者ID:ojs,项目名称:ojs,代码行数:29,代码来源:JournalFileController.php

示例4: indexAction

 public function indexAction()
 {
     $data = array();
     $source = new Entity('OjsJournalBundle:Publisher', 'application');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $query) use($tableAlias) {
         $query->andWhere($tableAlias . ".status = :status")->setParameter('status', 0);
         return $query;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $grid->getColumn('status')->manipulateRenderCell(function ($value) {
         return $this->get('translator')->trans(Publisher::$statuses[$value]);
     });
     $rowAction = array();
     $saveAction = new RowAction('<i class="fa fa-save"></i>', 'ojs_admin_application_publisher_save');
     $saveAction->setRouteParameters(['id']);
     $saveAction->setAttributes(['class' => 'btn btn-primary btn-xs', 'title' => $this->get('translator')->trans('institute.merge_as_new_institute')]);
     $rowAction[] = $saveAction;
     $rowAction[] = $gridAction->showAction('ojs_admin_application_publisher_show', 'id');
     $rowAction[] = $gridAction->editAction('ojs_admin_application_publisher_edit', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_application_publisher_delete', 'id');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsAdminBundle:AdminApplication:publisher.html.twig', $data);
 }
开发者ID:ojs,项目名称:ojs,代码行数:28,代码来源:AdminPublisherApplicationController.php

示例5: indexAction

 /**
  * Lists all ArticleFile entities.
  * @param   Integer $articleId
  * @return  Response
  */
 public function indexAction($articleId)
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     $article = $this->getDoctrine()->getRepository('OjsJournalBundle:Article')->find($articleId);
     $this->throw404IfNotFound($article);
     if (!$this->isGranted('VIEW', $journal, 'articles')) {
         throw new AccessDeniedException("You not authorized for this page!");
     }
     $source = new Entity('OjsJournalBundle:ArticleFile');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $qb) use($article, $tableAlias) {
         return $qb->where($tableAlias . '.article = :article')->setParameter('article', $article);
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_article_file_show', ['id', 'journalId' => $journal->getId(), 'articleId' => $articleId]);
     $rowAction[] = $gridAction->editAction('ojs_journal_article_file_edit', ['id', 'journalId' => $journal->getId(), 'articleId' => $articleId]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_article_file_delete', ['id', 'journalId' => $journal->getId(), 'articleId' => $articleId]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     $data['article'] = $article;
     return $grid->getGridResponse('OjsJournalBundle:ArticleFile:index.html.twig', $data);
 }
开发者ID:ojs,项目名称:ojs,代码行数:31,代码来源:ArticleFileController.php

示例6: indexAction

 /**
  * Lists all new Article submissions entities.
  * @param  bool $all
  * @return Response
  */
 public function indexAction($all = false)
 {
     $translator = $this->get('translator');
     /** @var Journal $currentJournal */
     $currentJournal = $this->get('ojs.journal_service')->getSelectedJournal();
     if ($all && !$this->isGranted('VIEW', $currentJournal, 'articles') || !$all && !$this->isGranted('CREATE', $currentJournal, 'articles')) {
         return $this->redirect($this->generateUrl('ojs_user_index'));
     }
     $user = $this->getUser();
     $source1 = new Entity('OjsJournalBundle:Article', 'submission');
     $source1TableAlias = $source1->getTableAlias();
     $source2 = new Entity('OjsJournalBundle:ArticleSubmissionProgress');
     $source2TableAlias = $source2->getTableAlias();
     if ($all) {
         $source1->manipulateQuery(function (QueryBuilder $qb) use($source1TableAlias, $currentJournal) {
             $qb->where($source1TableAlias . '.status = 0');
             $qb->andWhere($source1TableAlias . '.journalId = ' . $currentJournal->getId());
             return $qb;
         });
         $source2->manipulateQuery(function (QueryBuilder $qb) use($source2TableAlias, $currentJournal) {
             $qb->where($source2TableAlias . '.submitted = 0');
             $qb->andWhere($source2TableAlias . '.journalId = ' . $currentJournal->getId());
             return $qb;
         });
     } else {
         $source1->manipulateQuery(function (QueryBuilder $qb) use($source1TableAlias, $user, $currentJournal) {
             $qb->where($qb->expr()->andX($qb->expr()->eq($source1TableAlias . '.submitterId', $user->getId())));
             $qb->andWhere($source1TableAlias . '.journalId = ' . $currentJournal->getId());
             return $qb;
         });
         $source2->manipulateQuery(function (QueryBuilder $qb) use($source2TableAlias, $user, $currentJournal) {
             $qb->where($source2TableAlias . '.submitted = 0');
             $qb->andWhere($source2TableAlias . '.journalId = ' . $currentJournal->getId());
             $qb->andWhere($source2TableAlias . '.userId = ' . $user->getId());
             return $qb;
         });
     }
     $gridManager = $this->get('grid.manager');
     $submissionsGrid = $gridManager->createGrid('submission');
     $drafts = $gridManager->createGrid('drafts');
     $source1->manipulateRow(function ($row) use($translator) {
         $row->setField('status', $translator->trans(ArticleParams::statusText($row->getField('status'))));
         return $row;
     });
     $submissionsGrid->setSource($source1);
     $drafts->setSource($source2);
     /** @var GridAction $gridAction */
     $gridAction = $this->get('grid_action');
     $submissionsGrid->addRowAction($gridAction->showAction('ojs_journal_article_show', ['id', 'journalId' => $currentJournal->getId()]));
     $submissionsGrid->addRowAction($gridAction->editAction('ojs_journal_article_edit', ['id', 'journalId' => $currentJournal->getId()]));
     $submissionsGrid->addRowAction($gridAction->deleteAction('ojs_journal_article_delete', ['id', 'journalId' => $currentJournal->getId()]));
     $rowAction = [];
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->submissionResumeAction('article_submission_resume', 'id');
     $rowAction[] = $gridAction->deleteAction('article_submission_cancel', 'id');
     $actionColumn->setRowActions($rowAction);
     $drafts->addColumn($actionColumn);
     $data = ['page' => 'submission', 'submissions' => $submissionsGrid, 'drafts' => $drafts, 'all' => $all];
     return $gridManager->getGridManagerResponse('OjsJournalBundle:ArticleSubmission:index.html.twig', $data);
 }
开发者ID:necatikartal,项目名称:ojs,代码行数:65,代码来源:ArticleSubmissionController.php

示例7: indexAction

 /**
  * Lists all Design entities.
  *
  * @param Request $request
  * @return Response
  */
 public function indexAction(Request $request)
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'design')) {
         throw new AccessDeniedException("You are not authorized for view this journal's designs!");
     }
     $source = new Entity('OjsJournalBundle:Design');
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function ($query) use($tableAlias, $journal) {
         $query->andWhere($tableAlias . '.owner = :journal')->setParameter('journal', $journal);
     });
     $source->manipulateRow(function (Row $row) use($request) {
         /* @var Design $entity */
         $entity = $row->getEntity();
         if (!is_null($entity)) {
             $entity->getOwner()->setDefaultLocale($request->getDefaultLocale());
             $row->setField('owner', $entity->getOwner()->getTitle());
         }
         return $row;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_design_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_design_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_design_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsJournalBundle:Design:index.html.twig', $data);
 }
开发者ID:ojs,项目名称:ojs,代码行数:38,代码来源:DesignController.php

示例8: typeAction

 /**
  * Index view of content by type
  *
  * @param int $type
  * @return Response
  */
 public function typeAction($type)
 {
     $contentType = $this->get('opifer.content.content_type_manager')->getRepository()->find($type);
     if (!$contentType) {
         throw $this->createNotFoundException(sprintf('Content Type with ID %d could not be found.', $type));
     }
     $queryBuilder = $this->get('opifer.content.content_manager')->getRepository()->createValuedQueryBuilder('c');
     $source = new Entity($this->getParameter('opifer_content.content_class'));
     $source->initQueryBuilder($queryBuilder);
     $tableAlias = $source->getTableAlias();
     $source->manipulateQuery(function ($query) use($tableAlias, $contentType) {
         $query->andWhere($tableAlias . '.contentType = :contentType')->setParameter('contentType', $contentType);
     });
     $editAction = new RowAction('button.edit', 'opifer_content_contenteditor_design');
     $editAction->setRouteParameters(['id', 'type' => 'content']);
     //$deleteAction = new RowAction('button.delete', 'opifer_content_content_delete');
     //$deleteAction->setRouteParameters(['id']);
     /* @var $grid \APY\DataGridBundle\Grid\Grid */
     $grid = $this->get('grid');
     $grid->setId('content')->setSource($source)->addRowAction($editAction);
     //->addRowAction($deleteAction)
     foreach ($contentType->getSchema()->getAttributes() as $attribute) {
         $name = $attribute->getName();
         $column = new TextColumn(['id' => $name, 'field' => 'attributes.' . $attribute->getName() . '.value', 'title' => $attribute->getDisplayName()]);
         $column->manipulateRenderCell(function ($value, $row, $router) use($name) {
             $value = $row->getEntity()->getAttributes()[$name];
             return $value;
         });
         $grid->addColumn($column);
     }
     return $grid->getGridResponse($this->getParameter('opifer_content.content_type_view'), ['content_type' => $contentType, 'grid' => $grid]);
 }
开发者ID:dzoke,项目名称:Cms,代码行数:38,代码来源:ContentController.php

示例9: indexAction

 public function indexAction(Request $request)
 {
     $data = array();
     $source = new Entity('OjsJournalBundle:Journal');
     $source->manipulateRow(function (Row $row) use($request) {
         /* @var Journal $entity */
         $entity = $row->getEntity();
         $entity->setDefaultLocale($request->getDefaultLocale());
         if (!is_null($entity)) {
             $row->setField('title', $entity->getTitle());
         }
         return $row;
     });
     $alias = $source->getTableAlias();
     $source->manipulateQuery(function (QueryBuilder $query) use($alias) {
         $query->andWhere($alias . '.status = :status')->setParameter('status', JournalStatuses::STATUS_PREPARING);
         return $query;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $saveAction = new RowAction('<i class="fa fa-save"></i>', 'ojs_admin_application_journal_save');
     $saveAction->setRouteParameters(['id']);
     $saveAction->setAttributes(['class' => 'btn btn-primary btn-xs', 'title' => $this->get('translator')->trans('journal.merge_as_new_journal')]);
     $rowAction = array();
     $rowAction[] = $saveAction;
     $rowAction[] = $gridAction->editAction('ojs_admin_application_journal_edit', 'id');
     $rowAction[] = $gridAction->showAction('ojs_admin_application_journal_show', 'id');
     $rowAction[] = $gridAction->deleteAction('ojs_admin_application_journal_delete', 'id');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsAdminBundle:AdminApplication:journal.html.twig', $data);
 }
开发者ID:ulakjira,项目名称:ojs,代码行数:34,代码来源:AdminJournalApplicationController.php

示例10: 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

示例11: 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

示例12: indexAction

 /**
  * Lists all JournalIndex entities.
  *
  * @param Request $request
  * @return Response
  */
 public function indexAction(Request $request)
 {
     $journal = $this->get('ojs.journal_service')->getSelectedJournal();
     if (!$this->isGranted('VIEW', $journal, 'index')) {
         throw new AccessDeniedException("You are not authorized for view this page!");
     }
     $source = new Entity('OjsJournalBundle:JournalIndex');
     $source->manipulateRow(function (Row $row) use($request) {
         /* @var JournalIndex $entity */
         $entity = $row->getEntity();
         $entity->getJournal()->setDefaultLocale($request->getDefaultLocale());
         return $row;
     });
     $grid = $this->get('grid')->setSource($source);
     $gridAction = $this->get('grid_action');
     $actionColumn = new ActionsColumn("actions", 'actions');
     $rowAction[] = $gridAction->showAction('ojs_journal_index_show', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->editAction('ojs_journal_index_edit', ['id', 'journalId' => $journal->getId()]);
     $rowAction[] = $gridAction->deleteAction('ojs_journal_index_delete', ['id', 'journalId' => $journal->getId()]);
     $actionColumn->setRowActions($rowAction);
     $grid->addColumn($actionColumn);
     $data = [];
     $data['grid'] = $grid;
     return $grid->getGridResponse('OjsJournalBundle:JournalIndex:index.html.twig', $data);
 }
开发者ID:hasantayyar,项目名称:ojs,代码行数:31,代码来源:JournalIndexController.php

示例13: 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

示例14: indexAction

 /**
  * Lists all Citation entities.
  *
  * @param   Request $request
  * @param   Integer $articleId
  * @return  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');
 }
开发者ID:ojs,项目名称:ojs,代码行数:33,代码来源:CitationController.php

示例15: notFinishedAction

 /**
  * Returns setupFinished == false journals
  *
  * @param Request $request
  * @return Response
  */
 public function notFinishedAction(Request $request)
 {
     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 (QueryBuilder $query) use($tableAlias) {
         $query->andWhere($tableAlias . '.setupFinished = 0');
     });
     $source->manipulateRow(function (Row $row) use($request) {
         /* @var Journal $entity */
         $entity = $row->getEntity();
         $entity->setDefaultLocale($request->getDefaultLocale());
         if (!is_null($entity)) {
             $row->setField('title', $entity->getTitle());
             $row->setField('subtitle', $entity->getSubtitle());
             $row->setField('description', $entity->getDescription());
         }
         return $row;
     });
     $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_journal_settings_index', 'id')->setRouteParametersMapping(['id' => 'journalId']);
     $rowAction[] = $gridAction->cmsAction();
     $rowAction[] = $gridAction->deleteAction('ojs_admin_journal_delete', 'id');
     $rowAction[] = (new RowAction('Manage', 'ojs_journal_dashboard_index'))->setRouteParameters('id')->setRouteParametersMapping(array('id' => 'journalId'))->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:hasantayyar,项目名称:ojs,代码行数:41,代码来源:AdminJournalController.php


注:本文中的APY\DataGridBundle\Grid\Source\Entity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。