abstract class UploadedFilesHelper (View source)

Helper to re-organize uploaded file data for requests.

Methods

static array
upcastUploadedFiles(array $uploadedFiles, array $arguments, array $currentPath = [])

No description

upcastUploadedFile(UploadedFileInterface $uploadedFile, string|array $originallySubmittedResource = null, string $collectionName = null)

No description

static array
untangleFilesArray(array $convolutedFiles)

Transforms the convoluted _FILES superglobal into a manageable form.

static array
calculateFieldPathsAsArray(array $structure, string $firstLevelFieldName = null)

Returns an array of all possible "field paths" for the given array.

Details

static array upcastUploadedFiles(array $uploadedFiles, array $arguments, array $currentPath = [])

No description

Parameters

array $uploadedFiles

A (deep) array of UploadedFile or an untangled $_FILES array

array $arguments
array $currentPath

internal argument for recursion

Return Value

array

The nested array of paths and uploaded files

static protected FlowUploadedFile upcastUploadedFile(UploadedFileInterface $uploadedFile, string|array $originallySubmittedResource = null, string $collectionName = null)

No description

Parameters

UploadedFileInterface $uploadedFile
string|array $originallySubmittedResource
string $collectionName

Return Value

FlowUploadedFile

static array untangleFilesArray(array $convolutedFiles)

Transforms the convoluted _FILES superglobal into a manageable form.

Parameters

array $convolutedFiles

The _FILES superglobal or something with the same structure

Return Value

array

Untangled files

static protected array calculateFieldPathsAsArray(array $structure, string $firstLevelFieldName = null)

Returns an array of all possible "field paths" for the given array.

Parameters

array $structure

The array to walk through

string $firstLevelFieldName

Return Value

array

An array of paths (as arrays) in the format ["key1", "key2", "key3"] ...