src/Dpavic/JobsBundle/Controller/JobController.php
/**
     * Displays a form to edit an existing Job entity.
     *
     * @Route("/{token}/edit", name="job_edit")
     * @Method("GET")
     * @Template()
     */
Displays a form to edit an existing Job entity.
Displays a form to edit an existing Job entity .
public function editAction($token)
    {
        $em = $this->getDoctrine()->getManager();
        $entity = $em->getRepository('DpavicJobsBundle:Job')->findOneByToken($token);
        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Job entity.');
        }
        if ($entity->getIsActivated()) {
            throw $this->createNotFoundException('Job is activated and cannot be edited.');
        }
        $editForm = $this->createForm(new JobType(), $entity);
        $deleteForm = $this->createDeleteForm($token);
        return array(
            'entity' => $entity,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
public function editAction ( $ token ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ entity = $ em -> getRepository ( 'DpavicJobsBundle:Job' ) -> findOneByToken ( $ token ) ; if ( ! $ entity ) { throw $ this -> createNotFoundException ( 'Unable to find Job entity.' ) ; } if ( $ entity -> getIsActivated ( ) ) { throw $ this -> createNotFoundException ( 'Job is activated and cannot be edited.' ) ; } $ editForm = $ this -> createForm ( new JobType ( ) , $ entity ) ; $ deleteForm = $ this -> createDeleteForm ( $ token ) ; return array ( 'entity' => $ entity , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ; }
Displays a form to edit an existing Job entity.
Displays a form to edit an existing Job entity .