@param Request $request
@param         $id

@return Response
483712
public function subscriptionsAction(Request $request, $id)
    {
        $list = $this->getDoctrine()->getRepository('OpiferMailingListBundle:MailingList')->find($id);

        $source = new Entity('OpiferMailingListBundle:Subscription');
        $tableAlias = $source->getTableAlias();

        $source->manipulateQuery(function ($qb) use ($tableAlias, $id) {
            $qb->innerJoin($tableAlias . '.mailingList', 'm')
                ->andWhere('m.id = :list_id')
                ->setParameter('list_id', $id);
        });

        /* @var $grid \APY\DataGridBundle\Grid\Grid */
        $grid = $this->get('grid');
        $grid->setId('subscriptions_'.$id)
            ->setSource($source);

        return $grid->getGridResponse('OpiferMailingListBundle:MailingList:subscriptions.html.twig', ['list' => $list]);
    }
700611
public function update(Request $request, $id)
    {
        $node = Menu::where('id', $id)->first();

        $this->moveNode($request, $node);
        $this->updateNode($request, $node);

        return $this->response()->item($node, new NodeTransformer());
    }
560696
public function editAction(Request $request, $id)
    {
        $mailingList = $this->getDoctrine()->getRepository('OpiferMailingListBundle:MailingList')->find($id);

        $form = $this->createForm(MailingListType::class, $mailingList);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->flush();

            return $this->redirectToRoute('opifer_mailing_list_mailing_list_index');
        }

        return $this->render('OpiferMailingListBundle:MailingList:edit.html.twig', [
            'form' => $form->createView(),
            'mailing_list' => $mailingList,
        ]);
    }
670994
public function update($id, Request $request)
    {
        $routePermission = RoutePermission::find($id);

        if ($routePermission == null) {
            return response()->json(null, 404);
        }

        // validate
        $this->registerValidators();

        $validator = Validator::make($request->all(), [
            'route'         => 'sometimes|required|string|max:255|unique:route_permission,route,'.$id,
            'permissions'   => 'sometimes|required|array|max:255|rolePermission',
            'roles'         => 'sometimes|required|array|max:255|rolePermission'
        ]);

        if ($validator->fails()) {
            return response()->json(arrayView('phpsoft.users::errors/validation', [
                'errors' => $validator->errors()
            ]), 400);
        }

        $request['permissions'] = isset($request['permissions']) ?
            json_encode($request['permissions']) : $routePermission->permissions;
        $request['roles'] = isset($request['roles']) ?
            json_encode($request['roles']) : $routePermission->roles;

        // check current user is admin
        if (!(Auth::user() && Auth::user()->hasRole('admin'))) {
            return response()->json(null, 403);
        }

        // update permissions and roles for the route
        $routePermission = $routePermission->update($request->all());

        return response()->json(arrayView('phpsoft.users::routePermission/read', [
            'routePermission' => $routePermission
        ]), 200);
    }
247061
public function destroy(Request $request, $id)
    {
        $deleted = (new Services\GroupsService)->dataDelete($id, $request->all());
        return response()->json(['deleted' => $deleted]);
    }
456301
public function destroy(Request $request, $id)
    {
        $node = Menu::where('id', $id)->first();
        $node->delete();

        return $this->response()->noContent();
    }
604221
public function update(int $id, Request $request)
    {
        $attachment = Attachment::findOrFail($id)
            ->fill($request->all());

        $attachment->save();

        return response()->json($attachment);
    }
1368678
public function destroy(Request $request, $id)
    {
        $forceDelete = $request->get('force', false);

        $block = $this->repository->getByIdWithTrashed($id);

        if (!empty($block)) {
            $this->authorize('delete', $block);
            if ($forceDelete) {
                $this->repository->forceDelete($block);
            } else {
                $this->repository->delete($block);
            }
            return $this->respondWithSimpleSuccess(['success' => true]);
        }
        return $this->respondNotFound();
    }
217917
public function editAction(Request $request, $id)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_UPDATE);

        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model);

        return $this->createOrUpdate($request, $model, $form, Constants::ACTION_UPDATE, $crudConfigurator->getTemplate()->getEdit());
    }
834968
public function crudDelete(Request $request, $id)
    {
        try{
            $form = $this->createMultipleDeleteForm($request, $id);
            
            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $ids = $this->getIdsToDelete($id);
                $entities = $this->getRepository()->findById($ids);

                foreach ($entities as $entity){
                    if($entity){
                      $em->remove($entity);
                    }
                }
                
                $em->flush();
            }
            return new Response();
        }catch(\Exception $e){
          return $this->failure($e);
        }
    }
1311562
public function putAction(Request $request, $id)
    {
        $document = $this->findDocument($id, $this->getLocale($request));

        $this->requestHashChecker->checkHash($request, $document, $document->getUuid());
        if (!$this->checkAreaSnippet($request, $document)) {
            return new JsonResponse(
                [
                    'structures' => [],
                    'other' => [],
                    'isDefault' => true,
                ],
                409
            );
        }

        $this->processForm($request, $document);

        return $this->handleView($document);
    }
963392
public function crudUpdate(Request $request, $id)
    {
        try{
            $entity = $this->throwEntityNotFoundException($this->getRepository()->find($id));

            $form = $this->createForm($this->getEntityType(), $entity);
            $form->submit($request);
            
            $page = static::EDIT_VIEW;
            
            if ($form->isValid()) {
                $page = static::SHOW_VIEW;
                $this->saveEntity($entity);
                $form = $this->createDeleteForm($id)->createView();
                return $this->render($page, $this->commonsResponseVars(compact('entity','form')));
            }
            
            $form = $form->createView();
            $delete_form = $this->createDeleteForm($id)->createView();
            return $this->success($page, $this->commonsResponseVars(compact('entity','form','delete_form')));
            
        }catch(\Exception $e){
            return $this->failure($e);
        }
    }
1034741
public function copyAction(Request $request, $id)
    {
        $this->checkIfUserHasPermission(Permission::CREATE_DELETE);

        $entity = $this->getEntity($id);

        $this->getEventDispatcher()->dispatch(
            Events::PRE_CRUD_CONTROLLER_ACTION,
            new CrudControllerActionEvent($this->meta, __FUNCTION__)
        );

        $form = $this->getAdminFormFactory()->createCopyForm($entity, $this->entityClass)->handleRequest($request);

        $copy = $this->getFormHandler()->handleCopyForm($form, $entity);

        if (!empty($copy)) {
            $this->getEventDispatcher()->dispatch(CrudEvents::COPIED, new CopiedEvent($this->getUser(), $entity, $copy));
        }

        $url = $request->headers->get(
            'referer',
            $this->getAdminRouter()->generate($entity, $this->entityClass, AdminRouter::TYPE_INDEX)
        );

        return new RedirectResponse($url);
    }
1258403
public function deleteAction(Request $request, $id)
    {
        $manager = $this->get('opifer.content.content_manager');
        $content = $manager->getRepository()->find($id);

        $em = $this->get('doctrine')->getManager();
        $em->remove($content);
        $em->flush();

        return new JsonResponse(['success' => true]);
    }
180026
public function update($id,Request $request)
    {
        $setting = Setting::findOrfail($id);
    	
        $setting->name = $request->name;
        
        $setting->description = $request->description;
        
        
        $setting->save();

        return redirect('setting');
    }
1027597
public function detailAction($id, Request $request)
    {
        $record = $this->findNode($id);

        return $this->renderTemplate($record, $request);
    }
1218410
public function putAction(Request $request, $id)
    {
        try {
            $this->checkArguments($request);
            $locale = $this->getRequestParameter($request, 'locale', true);
            $user = $this->getUserManager()->save($request->request->all(), $locale, $id);
            $view = $this->view($user, 200);
        } catch (EntityNotFoundException $exc) {
            $view = $this->view($exc->toArray(), 404);
        } catch (UsernameNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (EmailNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (RestException $exc) {
            $view = $this->view($exc->toArray(), 400);
        }

        $this->addSerializationGroups($view);

        return $this->handleView($view);
    }