/**
  * @param int $id
  */
 public function initAction($id, $grantType = 'VIEW')
 {
     $redirectUrl = parent::initAction($id, $grantType);
     if ($redirectUrl) {
         return $redirectUrl;
     }
     $em = $this->getDoctrine()->getManager();
     $issueIntegrator = $em->getRepository('VersionControlGitControlBundle:ProjectIssueIntegrator')->findOneByProject($this->project);
     $this->issueManager = $this->get('version_control.issue_repository_manager');
     if ($issueIntegrator) {
         $this->issueManager->setIssueIntegrator($issueIntegrator);
     } else {
         $this->issueManager->setProject($this->project);
     }
     $this->issueRepository = $this->issueManager->getIssueRepository();
 }
 /**
  * Lists all Issue entities.
  *
  * @Template()
  */
 public function milestonesIssuesAction(Request $request, $id, $issueMilestone, $filter = 'open', $pageParameterName = 'page', $keywordParamaterName = 'keyword')
 {
     $em = $this->getDoctrine()->getManager();
     $this->project = $em->getRepository('VersionControlGitControlBundle:Project')->find($id);
     if (!$this->project) {
         throw $this->createNotFoundException('Unable to find Project entity.');
     }
     $this->initIssueMilestoneRepository($this->project);
     $parentRequest = $request->createFromGlobals();
     $keyword = $parentRequest->query->get($keywordParamaterName, false);
     $issueRepository = $this->issueManager->getIssueRepository();
     $data = $issueRepository->findIssuesInMilestones($issueMilestone->getId(), $filter, $keyword);
     //$data = $em->getRepository('VersionControlGitControlBundle:Issue')->findByProjectAndStatus($issueMilestone->getProject(),$filter,$keyword,$issueMilestone,true)->getQuery();
     $paginator = $this->get('knp_paginator');
     $pagination = $paginator->paginate($data, $parentRequest->query->getInt($pageParameterName, 1), 10, array('pageParameterName' => $pageParameterName));
     return array_merge($this->viewVariables, array('issueMilestone' => $issueMilestone, 'pagination' => $pagination, 'status' => $filter, 'keywordParamaterName' => $keywordParamaterName, 'keyword' => $keyword, 'project' => $this->project));
 }