Ojs\JournalBundle\Controller\JournalFileController::editAction PHP Method

editAction() public method

Displays a form to edit an existing Lang entity.
public editAction ( integer $id ) : Response
$id integer
return Symfony\Component\HttpFoundation\Response
    public function editAction($id)
    {
        /** @var JournalFile $entity */
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        $entity = $this->getDoctrine()->getRepository('OjsJournalBundle:JournalFile')->find($id);
        $this->throw404IfNotFound($entity);
        if (!$this->isGranted('EDIT', $journal, 'files')) {
            throw new AccessDeniedException("You are not authorized for this file!");
        }
        $token = $this->get('security.csrf.token_manager')->refreshToken('ojs_journal_filemanager' . $entity->getId());
        $editForm = $this->createEditForm($entity);
        return $this->render('OjsJournalBundle:JournalFile:edit.html.twig', ['token' => $token, 'entity' => $entity, 'edit_form' => $editForm->createView()]);
    }