Ojs\JournalBundle\Controller\SectionController::editAction PHP Метод

editAction() публичный Метод

Displays a form to edit an existing Section entity.
public editAction ( $id ) : Response
$id
Результат Symfony\Component\HttpFoundation\Response
    public function editAction($id)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        if (!$this->isGranted('EDIT', $journal, 'sections')) {
            throw new AccessDeniedException("You are not authorized for edit this journal's section!");
        }
        $em = $this->getDoctrine()->getManager();
        $entity = $em->getRepository('OjsJournalBundle:Section')->find($id);
        if (!$entity) {
            throw $this->createNotFoundException('notFound');
        }
        $editForm = $this->createEditForm($entity);
        return $this->render('OjsJournalBundle:Section:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
    }