Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Rest\Put("/{id}", requirements={"id": "\d+"})
- * @Rest\View(serializerGroups={"Default", "jakas_Grupa"})
- *
- * @SWG\Parameter(name="post", in="body", @Model(type=JakasEncjaTYpe::class))
- * @SWG\Response(
- * response=200,
- * description="Returns details of updated entity",
- * @Model(type=JakasEncjaTYpe::class, groups={"Default", "jakas_Grupa"})
- * )
- * @SWG\Response(
- * response=422,
- * description="Returns validation errors.",
- * )
- *
- * @param EntityManagerInterface $em
- * @param FormFactoryInterface $formFactory
- * @param Request $request
- * @param JakasEncja $jakasEncja
- *
- * @return View|FormInterface
- */
- ppublic function put(EntityManagerInterface $em, FormFactoryInterface $formFactory, Request $request, JakasEncja $jakasEncja)
- {
- $form = $formFactory->create(JakasEncjaType::class, $jakasEncja);
- if ($form->submit($request->request->all())->isSubmitted()) {
- if (!$form->isValid()) {
- return $form;
- }
- $em->persist($jakasEncja);
- $em->flush();
- }
- return View::create($jakasEncja, Response::HTTP_OK);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement