Get data as json for remoteapp-list

@param \Symfony\Component\HttpFoundation\Request $request

@return \Slashworks\AppBundle\Controller\Response
965849
public function indexDataAction(Request $request)
        {

            $aRemoteApps = RemoteAppQuery::create()->find();
            $sResult     = $this->renderView('SlashworksAppBundle:RemoteApp:data.json.twig', array(
                'entities' => $aRemoteApps,
            ));

            $response = new Response($sResult);
            $response->headers->set('Content-Type', 'application/json');

            return $response;

        }
889881
private function getContentFromRequest(Request $request): array
    {
        $data = json_decode($request->getContent(), true);
        foreach ($data as $key => $value) {
            if ($value === null || $value === '') {
                unset($data[$key]);
            }
        }
        return $data;
    }
654434
public function toResponse($request)
    {
        return tap(response()->json(
            $this->wrap(
                $this->resource->resolve($request),
                array_merge_recursive(
                    $this->paginationInformation($request),
                    $this->resource->with($request),
                    $this->resource->additional
                )
            ),
            $this->calculateStatus()
        ), function ($response) use ($request) {
            $response->original = $this->resource->resource->pluck('resource');

            $this->resource->withResponse($request, $response);
        });
    }
253297
private function requestToJson($request)
  {
    $jsonRequest = null;
    try {
      $jsonRequest = $this->serializer->serialize($request, 'json');
    } catch (RuntimeException $e) {
      throw new RuntimeException('Unable to serialize request ' . var_dump($request));
    }

    return $jsonRequest;
  }
218633
public function listAction(Request $request)
    {
        $this->checkAccess('LIST', null);
        $resources = $this->getResourceManager()->findAll();
        $view = $this->view($resources, \FOS\RestBundle\Util\Codes::HTTP_OK);
        return $this->handleView($view);
    }
390959
public function listAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse('AnimeDbCatalogBundle:Storage');
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        /* @var $rep StorageRepository */
        $rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Storage');

        return $this->render('AnimeDbCatalogBundle:Storage:list.html.twig', [
            'storages' => $rep->getList(),
        ], $response);
    }
365821
public function send(Request $request)
    {
        $response   = new GetResponse();
        $rpbGetReq  = $this->createRpbMessage($request);
        $rpbGetResp = $this->client->send($rpbGetReq, RiakMessageCodes::GET_REQ, RiakMessageCodes::GET_RESP);

        if ( ! $rpbGetResp instanceof RpbGetResp) {
            return $response;
        }

        if ( ! $rpbGetResp->hasContent()) {
            return $response;
        }

        $response->vClock      = $rpbGetResp->getVclock()->get();
        $response->contentList = $this->createContentList($rpbGetResp->getContentList());

        return $response;
    }
1229338
public function listAction(Request $request)
    {
        $objects = $this->get('doctrine.orm.default_entity_manager')->getRepository($request->get('class'))->findAll();
        // Fix for FOSRestBundle use
        if ($this->container->has('jms_serializer')) {
            return new Response($this->get('jms_serializer')->serialize($objects, 'json', SerializationContext::create()->setGroups(array('Default'))));
        }

        return new JsonResponse($objects);
    }
349853
public function send(Request $request)
    {
        $response   = new GetIndexResponse();
        $rpbGetReq  = $this->createRpbMessage($request);
        $rpbGetResp = $this->client->send($rpbGetReq, RiakMessageCodes::YOKOZUNA_INDEX_GET_REQ, RiakMessageCodes::YOKOZUNA_INDEX_GET_RESP);

        if ( ! $rpbGetResp instanceof RpbYokozunaIndexGetResp) {
            return $response;
        }

        if ( ! $rpbGetResp->hasIndex()) {
            return $response;
        }

        $rpbIndex = is_array($rpbGetResp->index)
            ? reset($rpbGetResp->index)
            : $rpbGetResp->index;

        $response->nVal   = $rpbIndex->n_val;
        $response->name   = $rpbIndex->name;
        $response->schema = $rpbIndex->schema;

        return $response;
    }
536209
public function functionAction(Request $request)
    {
        $selectFieldProviders = $this->get('phlexible_elementtype.select_field_providers');

        $providerName = $request->get('provider');
        $siterootId = $request->get('siterootId');
        $language = $request->get('language');
        $interfaceLanguage = $this->getUser()->getInterfaceLanguage('en');

        $provider = $selectFieldProviders->get($providerName);
        $data = $provider->getData($siterootId, $interfaceLanguage, $language);

        return new JsonResponse(['data' => $data]);
    }
663269
public function listJsonAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var \AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('CoreBundle:Page'));
        $jsonList->setLocale($request->getLocale());
        $response = $jsonList->get();
        

        return new JsonResponse($response);
    }
1289061
public function usersPickerListAction(Request $request)
    {
        return new JsonResponse($this->finder->search(
            User::class,
            array_merge(
                $request->query->all(),
                ['hiddenFilters' => [
                    'isEnabled' => true,
                    'isRemoved' => false,
                    'contactable' => true,
                ]]
            ),
            [Options::SERIALIZE_MINIMAL]
        ));
    }
1283598
public function listAction(Request $request): Response
    {
        $page = $request->query->get('page') ?? 1;

        $pagerfanta = new Pagerfanta(
            new ArrayAdapter($this->languageService->loadLanguages())
        );

        $pagerfanta->setMaxPerPage($this->defaultPaginationLimit);
        $pagerfanta->setCurrentPage(min($page, $pagerfanta->getNbPages()));

        /** @var Language[] $languageList */
        $languageList = $pagerfanta->getCurrentPageResults();

        $deleteLanguagesForm = $this->formFactory->deleteLanguages(
            new LanguagesDeleteData($this->getLanguagesNumbers($languageList))
        );

        return $this->render('@ezdesign/admin/language/list.html.twig', [
            'pager' => $pagerfanta,
            'form_languages_delete' => $deleteLanguagesForm->createView(),
            /* @deprecated since version 2.2, to be removed in 3.0. Use 'can_administrate' instead. */
            'canEdit' => $this->isGranted(new Attribute('content', 'translations')),
            /* @deprecated since version 2.2, to be removed in 3.0. Use 'can_administrate' instead. */
            'canAssign' => $this->isGranted(new Attribute('content', 'translations')),
            'can_administrate' => $this->isGranted(new Attribute('content', 'translations')),
        ]);
    }
1277459
public function getJsonParams(Request $request)
    {
        $request_params = [];

        if (0 === mb_strpos($request->headers->get('Content-Type'), 'application/json')) {
            $request_params = json_decode($request->getContent(), true);
        }

        return $request_params;
    }
1094591
public function toArray($request)
    {
        return $this->resource->map(function($value) use($request) {
            return 'local' == config('app.env') && $request->has('__message') ?
            $this->transform($this->message()) : $this->transform($this->template($value));
        });
    }
179189
protected function getData(Request $request)
    {
        $data = null;
        if ($request->query->has('dataId')) {
            $data = $this->get(DataRepository::class)->find($request->query->get('dataId'));
        }

        return $data;
    }
261982
public function getAll(Request $request)
    {
        $this->authorize(MediasPolicy::PERMISSION_LIST);

        return $this->jsonResponseSuccess([
            'medias' => $this->media->all(
                $request->get('location', '/')
            ),
        ]);
    }