DeleteUploadsFinisher extends AbstractFinisher
This finisher remove the submitted files.
Use this e.g after the email finisher if you don't want to keep the files online.
Scope: frontend
Table of Contents
Properties
- $defaultOptions : array<string|int, mixed>
- These are the default options of the finisher.
- $finisherContext : FinisherContext
- $finisherIdentifier : string
- $options : array<string|int, mixed>
- The options which have been set from the outside. Instead of directly accessing them, you should rather use parseOption().
- $shortFinisherIdentifier : string
Methods
- execute() : string|null
- Executes the finisher
- getFinisherIdentifier() : string
- isEnabled() : bool
- Returns whether this finisher is enabled
- setFinisherIdentifier() : void
- setOption() : mixed
- Sets a single finisher option (@see setOptions())
- setOptions() : mixed
- deleteEmptyUploadFolders() : void
- note: TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter::importUploadedResource() creates a sub-folder for file uploads (e.g. .../form_<40-chars-hash>/actual.file)
- executeInternal() : string|null
- Executes this finisher
- getTypoScriptFrontendController() : TypoScriptFrontendController
- isEmptyFolder() : bool
- parseOption() : string|array<string|int, mixed>|int|null
- Read the option called $optionName from $this->options, and parse {...} as object accessors.
- resolveRuntimeReference() : int|string|array<string|int, mixed>
- Resolving property by name from submitted form data.
- substituteRuntimeReferences() : mixed
- You can encapsulate an option value with {}.
- translateFinisherOption() : array<string|int, mixed>|string
- Wraps TranslationService::translateFinisherOption to recursively invoke all array items of resolved form state values or nested finisher option configuration settings.
Properties
$defaultOptions
These are the default options of the finisher.
protected
array<string|int, mixed>
$defaultOptions
= []
Override them in your concrete implementation. Default options should not be changed from "outside"
$finisherContext
protected
FinisherContext
$finisherContext
$finisherIdentifier
protected
string
$finisherIdentifier
= ''
$options
The options which have been set from the outside. Instead of directly accessing them, you should rather use parseOption().
protected
array<string|int, mixed>
$options
= []
$shortFinisherIdentifier
protected
string
$shortFinisherIdentifier
= ''
Methods
execute()
Executes the finisher
public
final execute(FinisherContext $finisherContext) : string|null
Parameters
- $finisherContext : FinisherContext
-
The Finisher context that contains the current Form Runtime and Response
Return values
string|nullgetFinisherIdentifier()
public
getFinisherIdentifier() : string
Return values
stringisEnabled()
Returns whether this finisher is enabled
public
isEnabled() : bool
Return values
boolsetFinisherIdentifier()
public
setFinisherIdentifier(string $finisherIdentifier) : void
Parameters
- $finisherIdentifier : string
-
The identifier for this finisher
setOption()
Sets a single finisher option (@see setOptions())
public
setOption(string $optionName, mixed $optionValue) : mixed
Parameters
- $optionName : string
-
name of the option to be set
- $optionValue : mixed
-
value of the option
setOptions()
public
setOptions(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
-
configuration options in the format ['option1' => 'value1', 'option2' => 'value2', ...]
deleteEmptyUploadFolders()
note: TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter::importUploadedResource() creates a sub-folder for file uploads (e.g. .../form_<40-chars-hash>/actual.file)
protected
deleteEmptyUploadFolders(array<string|int, Folder> $folders) : void
Parameters
- $folders : array<string|int, Folder>
executeInternal()
Executes this finisher
protected
executeInternal() : string|null
Tags
Return values
string|nullgetTypoScriptFrontendController()
protected
getTypoScriptFrontendController() : TypoScriptFrontendController
Return values
TypoScriptFrontendControllerisEmptyFolder()
protected
isEmptyFolder(Folder $folder) : bool
Parameters
- $folder : Folder
Return values
boolparseOption()
Read the option called $optionName from $this->options, and parse {...} as object accessors.
protected
parseOption(string $optionName) : string|array<string|int, mixed>|int|null
Then translate the value.
If $optionName was not found, the corresponding default option is returned (from $this->defaultOptions)
Parameters
- $optionName : string
Return values
string|array<string|int, mixed>|int|nullresolveRuntimeReference()
Resolving property by name from submitted form data.
protected
resolveRuntimeReference(string $property, FormRuntime $formRuntime) : int|string|array<string|int, mixed>
Parameters
- $property : string
- $formRuntime : FormRuntime
Return values
int|string|array<string|int, mixed>substituteRuntimeReferences()
You can encapsulate an option value with {}.
protected
substituteRuntimeReferences(string|array<string|int, mixed> $needle, FormRuntime $formRuntime) : mixed
This enables you to access every gettable property from the TYPO3\CMS\Form\Domain\Runtime\FormRuntime.
For example: {formState.formValues.<elementIdentifier>} or {<elementIdentifier>}
Both examples are equal to "$formRuntime->getFormState()->getFormValues()[<elementIdentifier>]" There is a special option value '{__currentTimestamp}'. This will be replaced with the current timestamp.
Parameters
- $needle : string|array<string|int, mixed>
- $formRuntime : FormRuntime
translateFinisherOption()
Wraps TranslationService::translateFinisherOption to recursively invoke all array items of resolved form state values or nested finisher option configuration settings.
protected
translateFinisherOption(string|array<string|int, mixed> $subject, FormRuntime $formRuntime, string $optionName, string|array<string|int, mixed> $optionValue, array<string|int, mixed> $translationOptions) : array<string|int, mixed>|string
Parameters
- $subject : string|array<string|int, mixed>
- $formRuntime : FormRuntime
- $optionName : string
- $optionValue : string|array<string|int, mixed>
- $translationOptions : array<string|int, mixed>