/** * Edit an Experience in the database. * * @param VBeeSiteApplication $app * @param Request $request * * @return Response */ public function editAction(VBeeSiteApplication $app, Request $request) { $person = $this->retrievePerson($request->get('personId')); $experience = $this->retrieveExperience($request->get('experienceId'), $person); /** @var FormInterface $form */ $form = $app['form.factory']->create('experience', $experience); $form->handleRequest($request); if ($form->isValid()) { $this->getExperienceManager()->save($experience); return $app->redirect($app->path('admin_person_show', ['personId' => $person->getId()])); } return $app->render('Experience/edit.html.twig', ['person' => $person, 'form' => $form->createView()]); }
/** * Edit a Organization in the database. * * @param VBeeSiteApplication $app * @param Request $request * * @return Response */ public function editAction(VBeeSiteApplication $app, Request $request) { $organization = $this->retrieveOrganization($request->get('organizationId')); /** @var FormInterface $form */ $form = $app['form.factory']->create('organization', $organization); $form->handleRequest($request); if ($form->isValid()) { /** @var Organization $organization */ $organization = $form->getData(); $this->getOrganizationManager()->save($organization); return $app->redirect($app->path('admin_organization_list')); } return $app->render('Organization/edit.html.twig', ['form' => $form->createView()]); }
/** * Edit a Person in the database. * * @param VBeeSiteApplication $app * @param Request $request * * @return Response */ public function editAction(VBeeSiteApplication $app, Request $request) { $person = $this->retrievePerson($request->get('personId')); /** @var FormInterface $form */ $form = $app['form.factory']->create('person', $person); $form->handleRequest($request); if ($form->isValid()) { // TODO: remove this, useless! /** @var Person $person */ $person = $form->getData(); $this->getPersonManager()->save($person); return $app->redirect($app->path('admin_person_list')); } return $app->render('Person/edit.html.twig', ['form' => $form->createView()]); }