@param BatchRequest $request

@return array
513316
protected function emulateBatchResponse(BatchRequest $request)
    {
        $response = [];
        foreach ($request as $req) {
            $response[] = $this->emulateResponse($req);
        }

        return $response;
    }
763188
public function getReturnObject($request)
    {
        if (array_key_exists('isBatchPart', $request->options) && $request->options['isBatchPart'] === true) {
            return $request;
        } else {
            return $request->send();
        }
    }
1064493
public function getDatas($request)
    {
        $relation = $this->options['relation'];
        $columnParams = explode('.',$this->options['column']);
        if ( ! $relation ) {
            return [
                'relation_type'     => 'not',
                'datas' => [
                    $columnParams[0]    => $this->fileName,
                    'size'              => $this->fileSize
                ]
            ];
        }
        $datas = [];
        foreach ($this->files as $file) {
            $data = [
                $columnParams[1]    => $file['fileName'],
                'size'              => $file['fileSize']
            ];
            if ((isset($this->options['group']) && isset($this->options['add_column'])) || isset($this->options['add_column'])) {
                foreach($this->options['add_column'] as $column) {
                    $columnData = isset($this->options['group'])
                        ? "{$this->options['group']}.{$this->options['index']}.{$column}"
                        : (isset($this->options['inputPrefix']) ? $this->options['inputPrefix'] . $column : $column);
                    $columnData = $request->input($columnData);
                    if ($columnData) {
                        $data[$column] = $columnData;
                    }
                }
            }
            $datas[] = $data;
        }

        return  [
            'relation_type'     => $relation,
            'relation'          => $columnParams[0],
            'relation_model'    => $this->options['relation_model'],
            'is_reset'          => isset($this->options['is_reset']) && $this->options['is_reset'] ? true : false,
            'changeToHasOne'    => isset($this->options['changeToHasOne']) ? $this->options['changeToHasOne'] : false,
            'datas'             => $relation === 'hasOne' ? $datas[0] : $datas
        ];
    }
27201
protected function parseIncomingRequest($request)
    {
        if (! $request) {
            $request = LumenRequest::capture();
        }

        $this->instance(Request::class, $this->prepareRequest($request));

        return [$request->getMethod(), '/'.\trim($request->getPathInfo(), '/')];
    }
787818
private function input(Request $request)
    {
        $files = $request->files->all();

        array_walk_recursive($files, function (&$file) {
            $file = [
                'name' => $file->getClientOriginalName(),
                'size' => $file->isFile() ? ($file->getSize() / 1000).'KB' : '0',
            ];
        });

        return array_replace_recursive($request->input(), $files);
    }
490788
public function toArray($request)
    {
        return [
            'id'              => (int) $this->id,
            'author_id'       => $this->author_id,
            'language_code'   => $this->language_code,
            'title'           => $this->title,
            'teaser'          => $this->teaser,
            'body'            => $this->body,
            'seo_title'       => $this->seo_title,
            'seo_description' => $this->seo_description,
            'is_active'       => $this->is_active,
            'created_at'      => dateTimeToRequestTimezone($this->created_at)->toIso8601String(),
            'updated_at'      => dateTimeToRequestTimezone($this->updated_at)->toIso8601String(),
        ];
    }
739465
private function getEcommerceItemsFromRequest(Request $request)
    {
        $items = $request->getParam('ec_items');

        if (empty($items)) {
            Common::printDebug("There are no Ecommerce items in the request");
            // we still record an Ecommerce order without any item in it
            return array();
        }

        if (!is_array($items)) {
            Common::printDebug("Error while json_decode the Ecommerce items = " . var_export($items, true));
            return false;
        }

        $items = Common::unsanitizeInputValues($items);

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

        return $this->jsonResponseSuccess([
            'medias' => $this->media->all(
                $request->get('location', '/')
            ),
        ]);
    }
747421
public function toArray($request)
    {
        return [
            'id'            => (int) $this->id,
            'author_id'     => $this->author_id,
            'language_code' => $this->language_code,
            'title'         => $this->title,
            'body'          => $this->body,
            'custom_fields' => $this->custom_fields,
            'is_active'     => $this->is_active,
            'created_at'    => $this->created_at->toIso8601String(),
            'updated_at'    => $this->updated_at->toIso8601String(),
        ];
    }
1310244
protected function getIds( $request )
	{
		$ids = [];

		if( isset( $request->data ) )
		{
			foreach( (array) $request->data as $entry )
			{
				if( isset( $entry->id ) ) {
					$ids[] = $entry->id;
				}
			}
		}

		return $ids;
	}
1127959
public function get_items( $request ) {

		// Register missing routes
		$this->registerRouteDependencies();

		// Override search request
		$search = $request->get_query_params();
		unset( $search['per_page'], $search['next'] );
		$request['search'] = ! empty( $search ) ? $search : [
			null => null,
		]; // Set some weird value that means abort

		$response = rest_ensure_response( $this->searchBooks( $request ) );
		unset( $request['search'] );

		$this->addNextSearchLinks( $request, $response );

		return $response;
	}
554723
public function batchAction(Request $request)
    {
        $view = $this->getGridHandler()->handle(
            $grid = $this->buildGrid(),
            $form = $this->submitGrid($grid, $request)
        );

        if (($api = $this->getParameterResolver()->resolveApi()) && !$form->isValid()) {
            return $this->processAction('batch', $form);
        }

        $batchForm = $this->buildForm(GridBatchType::class, null, ['grid' => $view]);

        if ($this->submitForm($batchForm, $request)->isValid() && $form->isValid()) {
            try {
                $this->getGridBatcher()->batch($grid, $batchForm);
            } catch (DomainException $e) {
                $this->processException($e);
            }
        }

        if (!$api && !$batchForm->isValid()) {
            return $this->processView('batch', $this->view([
                'batch_form' => $batchForm,
                'form'       => $form,
                'grid'       => $view,
            ]));
        }

        return $this->processAction('batch', $batchForm);
    }
458506
public function index(Request $request)
    {
        $jobs = $this->jobs->getRecent($request->query('starting_at', -1))->map(function ($job) {
            $job->payload = json_decode($job->payload);

            return $job;
        })->values();

        return [
            'jobs' => $jobs,
            'total' => $this->jobs->countRecent(),
        ];
    }
18245
public function toArray($request)
    {
        return [
            'id'                 => (int) $this->id,
            'parent_id'          => $this->parent_id,
            'author_id'          => $this->author_id,
            'level'              => $this->level,
            'type'               => $this->whenLoaded('type', function () {
                return $this->type->name;
            }),
            'thumbnail'          => $this->whenLoaded('thumb', function () {
                return new File($this->thumb);
            }),
            'theme'              => $this->theme,
            'weight'             => $this->weight,
            'rating'             => $this->rating,
            'is_on_home'         => $this->is_on_home,
            'is_comment_allowed' => $this->is_comment_allowed,
            'is_promoted'        => $this->is_promoted,
            'is_sticky'          => $this->is_sticky,
            'path'               => $this->buildPath($this->path),
            'published_at'       => optional(dateTimeToRequestTimezone($this->published_at))->toIso8601String(),
            'created_at'         => dateTimeToRequestTimezone($this->created_at)->toIso8601String(),
            'updated_at'         => dateTimeToRequestTimezone($this->updated_at)->toIso8601String(),
            'routes'             => $this->whenLoaded('routes', function () {
                return Route::collection($this->routes);
            }),
            'translations'       => ContentTranslation::collection($this->whenLoaded('translations')),
            'children'           => $this->when(!empty($this->children), function () {
                return Content::collection($this->children);
            }),
        ];
    }
222066
public function parse(Request $request): array
    {
        // Extracts the GraphQL request parameters
        $queries = $this->getParsedBody($request);

        if (empty($queries)) {
            throw new BadRequestHttpException('Must provide at least one valid query.');
        }

        foreach ($queries as $i => &$query) {
            $query = \array_filter($query) + self::$queriesDefaultValue;

            if (!\is_string($query[static::PARAM_QUERY])) {
                throw new BadRequestHttpException(\sprintf('%s is not a valid query', \json_encode($query[static::PARAM_QUERY])));
            }
        }

        return $queries;
    }
1169141
public function indexAction(Request $request)
    {
        $viewIndex = $this->get('phlexible_gui.view.index');

        return [
            'scripts' => $viewIndex->get($request),
            'noScript' => $viewIndex->getNoScript(),
        ];
    }
1142580
public function delete(ThumbnailRequest $request)
    {
        $crudeName = $request->input('crudeName');
        $crude = CrudeInstance::get($crudeName);
        $id = $request->input('model_id');
        $column = $request->input('model_column');

        $model = $crude->deleteThumbnailByIdAndColumn($id, $column);

        return ['model' => $model];
    }