Exemple #1
0
 /**
  * @ParamConverter("build", options={"mapping": {"meta": "meta", "branch": "branch", "build": "version"}, "repository_method" = "findOneWithParents"})
  */
 public function processForceFailAction(Request $request, Build $build)
 {
     $branch = $build->getBranch();
     $meta = $branch->getMeta();
     if (false === $this->isGranted('EDIT', $meta)) {
         throw new AccessDeniedException('Unauthorised access!');
     }
     if ($build->getState() == Build::PROCESSING) {
         $build->setState(Build::FAILED);
         $this->getDoctrine()->getManager()->flush();
         $request->getSession()->getFlashBag()->add('warning', "Build <strong>version " . $build->getVersion() . "</strong> has been marked as failed. Processing canceled.");
     }
     return $this->redirect($this->generateUrl('hlp_nebula_repository_build_edit', array('meta' => $meta, 'branch' => $branch, 'build' => $build)));
 }