Renew url list of records

@param Request $request

@return Response
518765
public function renewUrl(Request $request)
    {
        $records = RecordsRequest::fromRequest($this->app, $request, !!$request->request->get('renew_children_url'));

        $renewed = [];
        foreach ($records as $record) {
            $renewed[$record->getId()] = (string) $record->get_preview()->renew_url();
        };

        return $this->app->json($renewed);
    }
216026
function indexAction($request)
    {

        $response = new FrontendResponse('journal/journalList.twig', $request);

        $journalRepository = new Repository(new Journal(),$this->database);

        $journals = $journalRepository->findAll();

        $journals = array_reverse($journals);

        $response->setTwigVariables(
            [
                'journals' => $journals
            ]
        );

        return $response;


        // $insertJournal = new \Model\Entity\Journal(NULL,'title','content');
        // $journalRepository->update($insertJournal);


        // $journal = $journalRepository->findById(1);
        // $journalRepository->remove($journal);

        // $filter = new Filter($this->database);
        // $filter->addCondition(new Condition('content','<>','content'));
        // $journals = $journalRepository->findByFilter($filter);

    }
625028
protected function retriesLeft(Request $request)
    {
        return $this->limiter()->retriesLeft($this->throttleKey($request), $this->maxAttempts());
    }
482457
protected function getBackUrl(Request $request)
    {
        if (($backUrl = $request->input('_redirectBack')) == \URL::previous()) {
            $backUrl = null;
            $request->merge(['_redirectBack' => $backUrl]);
        }

        return $backUrl;
    }
993048
public function renewAccessToken(Request $request, ApiApplication $application)
    {
        $this->assertJsonRequestFormat($request);

        $account = $this->getApiAccountRepository()
            ->findByUserAndApplication($this->getAuthenticatedUser(), $application);
        if (null === $account) {
            $this->app->abort(404, sprintf('Account not found for application %s', $application->getName()));
        }

        if (null !== $devToken = $this->getApiOAuthTokenRepository()->findDeveloperToken($account)) {
            $this->getApiOAuthTokenManipulator()->renew($devToken);
        } else {
            // dev tokens do not expires
            $devToken = $this->getApiOAuthTokenManipulator()->create($account);
        }

        return $this->app->json(['success' => true, 'token' => $devToken->getOauthToken()]);
    }
449683
public function refreshAction(Request $request) {
        try {
            $refreshCode = $this->getRefreshCode($request);

            $clientSecret = $this->getClientSecret($request);
            $credentials = $this->accessProvider->refresh($request, $refreshCode, $clientSecret);

            $response = new JsonResponse([
                'access_code' => $credentials->getAccessCode(),
                'refresh_code' => $credentials->getRefreshCode(),
                'lifetime' => $credentials->getLifetime()
            ]);
        } catch (SoauthException $e) {
            $data = [];

            if($e instanceof BadDataException) {
                $data['errors'] = $e->getErrors();
            }

            $response = new JsonResponse($data, Response::HTTP_BAD_REQUEST);
        }

        $this->info('< Response', ['status_code' => $response->getStatusCode()]);

        return $response;
    }
812771
public function getPage(Request $request)
    {
        $parameters = $this->fixParameters($request->query->all());

        $transUnits = $this->storage->getTransUnitList(
            $this->localeManager->getLocales(),
            $request->query->get('rows', 20),
            $request->query->get('page', 1),
            $parameters
        );

        $count = $this->storage->countTransUnits($this->localeManager->getLocales(), $parameters);

        return array($transUnits, $count);
    }
1242464
public function indexAction(Request $request)
    {
        $layouts = $this->get('opifer.content.layout_manager')->getRepository()
            ->findAll();

        $data = $this->get('jms_serializer')->serialize($layouts, 'json');

        return new Response($data, 200, ['Content-Type' => 'application/json']);
    }
689490
public function listAction(Request $request)
    {
        $current_page = $request->get('page', 1);
        $current_page = $current_page > 1 ? $current_page : 1;
        $rep = $this->getRepository();

        // filter list notice
        $filter = $this->createForm('notices_filter')->handleRequest($request);
        if ($filter->isValid()) {
            $query = $rep->getFilteredQuery($filter->getData()['status'], $filter->getData()['type']);
        } else {
            $query = $rep->createQueryBuilder('n');
        }
        $query
            ->orderBy('n.date_created', 'DESC')
            ->setFirstResult(($current_page - 1) * self::NOTICE_PER_PAGE)
            ->setMaxResults(self::NOTICE_PER_PAGE);
        $list = $query->getQuery()->getResult();

        // get count all items
        $count = $query
            ->select('COUNT(n)')
            ->getQuery()
            ->getSingleScalarResult();

        // pagination
        $that = $this;
        $request_query = $request->query->all();
        unset($request_query['page']);
        $pagination = $this->get('anime_db.pagination')
            ->create(ceil($count / self::NOTICE_PER_PAGE), $current_page)
            ->setPageLink(function ($page) use ($that, $request_query) {
                return $that->generateUrl('notice_list', array_merge($request_query, ['page' => $page]));
            })
            ->setFirstPageLink($this->generateUrl('notice_list', $request_query))
            ->getView();

        return $this->render('AnimeDbCatalogBundle:Notice:list.html.twig', [
            'list' => $list,
            'pagination' => $pagination,
            'change_form' => $this->createForm(new ChangeNotice())->createView(),
            'filter' => $filter->createView(),
            'action_remove' => ChangeNotice::ACTION_REMOVE,
        ]);
    }
905333
public function view($request)
    {
        if (!$this->currentRecord) {
            return $this->httpError(404, "{$this->recordType} not found");
        }
        if (!$this->currentRecord->canView()) {
            return $this->httpError(403, "You do not have permission to view this {$this->recordType}");
        }
        $form = $this->Form();
        $form->setActions(new FieldList());
        $form->makeReadonly();
        return $this->customise(array('Form' => $form));
    }
210959
public function index(Request $request)
    {
        $this->validate($request, ['category_id' => ['required']]);

        $threads = $this->model()
            ->withRequestScopes($request)
            ->where('category_id', $request->input('category_id'))
            ->get();

        return $this->response($threads);
    }
987930
public function listAction(Request $request)
    {
        $this->denyAccessUnlessGranted(ContributionActionInterface::READ, ContentTypeInterface::ENTITY_TYPE);
        $mapping = array(
            'name' => 'names',
            'content_type_id' => 'contentTypeId',
            'linked_to_site' => 'linkedToSite'
        );
        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
        $repository = $this->get('open_orchestra_model.repository.content_type');

        $collection = $repository->findAllNotDeletedInLastVersionForPaginate($configuration);
        $recordsTotal = $repository->countByContentTypeInLastVersion();
        $recordsFiltered = $repository->countNotDeletedInLastVersionWithSearchFilter($configuration);
        $facade = $this->get('open_orchestra_api.transformer_manager')->transform('content_type_collection', $collection);
        $facade->recordsTotal = $recordsTotal;
        $facade->recordsFiltered = $recordsFiltered;

        return $facade;
    }
42861
public final function generateResponseForRequest(Request $request)
    {
        $this->setAsRunningApplication();
        $this->request = $request;
        $this->activeRequest = $request;

        $additionalData = [];
        if ($request instanceof WebRequest) {
            if (!empty($request->GetData)) {
                $additionalData = $request->GetData;
            }
        }

        Log::createEntry(Log::PERFORMANCE_LEVEL | Log::DEBUG_LEVEL, function () use ($request) {
            if ($request instanceof WebRequest) {
                return "Generating response for url " . $request->urlPath;
            }

            if ($request instanceof CliRequest) {
                return "Starting CLI response";
            }

            return "";
        }, "ROUTER", $additionalData);

        Log::indent();

        // an empty-string Response to fall back on if nothing else is generated
        $response = new HtmlResponse();
        $response->setContent('');

        try {

            // Run pre-response filters.
            $preFilters = $this->getAllResponseFilters(true);

            foreach($preFilters as $filter){
                $response = $filter->processResponse($response);
            }

            $filterResponse = true;

            // Iterate over each handler and ask them to generate a response.
            // If they do return a response we return that and exit the loop.
            // If they return false then we assume they couldn't handle the URL
            // and continue to the next handler.
            foreach ($this->rootHandlers as $handler) {
                $generatedResponse = $handler->generateResponse($request);

                if ($generatedResponse !== false) {
                    Log::debug(function () use ($handler) {
                        return ["Handler `" . get_class($handler) . "` generated response.", []];
                    }, "ROUTER");

                    // it should be preferred for a handler to return a Response object,
                    // but checking this here retains the option for them to just return
                    // their output
                    if ($generatedResponse instanceof Response) {
                        $response = $generatedResponse;
                    } else {
                        $response->setContent($generatedResponse);
                    }

                    break;
                }
            }
        } catch (ForceResponseException $er) {
            // Clear any previous output in buffers to ensure we only send the forced response
            while (ob_get_level()) {
                ob_end_clean();
            }

            $response = $er->getResponse();
            $filterResponse = false;
        } catch (StopGeneratingResponseException $er) {
            $filterResponse = false;
        } catch (RhubarbException $er) {
            $handler = $this->container()->getInstance(ExceptionHandler::class);
            $response = $handler->processException($er);
        } catch (\Exception $er) {
            $handler = $this->container()->getInstance(ExceptionHandler::class);
            $response = $handler->processException(new NonRhubarbException($er));
        }

        if ($filterResponse) {
            Log::createEntry(Log::PERFORMANCE_LEVEL | Log::DEBUG_LEVEL, "Output filters started", "ROUTER");
            Log::indent();

            $filters = $this->getAllResponseFilters();

            foreach ($filters as $filter) {
                $response = $filter->processResponse($response);
            }

            Log::createEntry(Log::PERFORMANCE_LEVEL | Log::DEBUG_LEVEL, "Output filters finished", "ROUTER");
            Log::outdent();
        }

        Log::performance("Response generated", "ROUTER");
        Log::outdent();

        return $response;
    }
70978
public function index(Request $request)
    {
        $routePermissions = RoutePermission::browse([
            'order'     => [ Input::get('sort', 'id') => Input::get('direction', 'desc') ],
            'limit'     => ($limit = (int)Input::get('limit', 25)),
            'offset'    => (Input::get('page', 1) - 1) * $limit,
            'filters'   => $request->all()
        ]);

        return response()->json(arrayView('phpsoft.users::routePermission/browse', [
            'routePermissions' => $routePermissions,
        ]), 200);
    }
1256517
public function listAction(Request $request): Response
    {
        $deletableContentTypeGroup = [];
        $count = [];

        $page = $request->query->get('page') ?? 1;

        $pagerfanta = new Pagerfanta(
            new ArrayAdapter($this->contentTypeService->loadContentTypeGroups())
        );

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

        /** @var \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup[] $contentTypeGroupList */
        $contentTypeGroupList = $pagerfanta->getCurrentPageResults();

        $deleteContentTypeGroupsForm = $this->formFactory->deleteContentTypeGroups(
            new ContentTypeGroupsDeleteData($this->getContentTypeGroupsNumbers($contentTypeGroupList))
        );

        foreach ($contentTypeGroupList as $contentTypeGroup) {
            $contentTypesCount = count($this->contentTypeService->loadContentTypes($contentTypeGroup));
            $deletableContentTypeGroup[$contentTypeGroup->id] = !(bool)$contentTypesCount;
            $count[$contentTypeGroup->id] = $contentTypesCount;
        }

        return $this->render('@ezdesign/admin/content_type_group/list.html.twig', [
            'pager' => $pagerfanta,
            'form_content_type_groups_delete' => $deleteContentTypeGroupsForm->createView(),
            'deletable' => $deletableContentTypeGroup,
            'content_types_count' => $count,
            'can_create' => $this->isGranted(new Attribute('class', 'create')),
            'can_update' => $this->isGranted(new Attribute('class', 'update')),
            'can_delete' => $this->isGranted(new Attribute('class', 'delete')),
        ]);
    }
709705
public function route(Request $request)
    {
        foreach ($this->getRouterList() as $router) {
            if ($router->getAPIClient()->shouldRouteRequest($request)) {
                return $router->route($request);
            }
        }

        return;
    }
431194
public function resend(Request $request)
    {
        $user = Auth::user();

        if ($user->getVerified()) {
            return redirect()->back();
        }

        $response = VerifyEmail::sendVerificationLink($user, function (Message $message) use ($user) {
            $message->subject($user->getVerifyEmailSubject());
        });

        switch ($response) {
            case VerifyEmail::VERIFY_LINK_SENT:
                return redirect()->back()->with('status', trans($response));
        }
    }