ReportNewAction
in package
FinalYes
Table of Contents
Properties
- $creator : ReportAdd
- $responder : Responder
- $storageDirectory : string
- $tempDirectory : string
Methods
- __construct() : mixed
- __invoke() : ResponseInterface
- Action.
- moveUploadedFile() : string
- Moves the uploaded file to the upload directory and assigns it a unique name to avoid overwriting an existing uploaded file.
Properties
$creator
private
ReportAdd
$creator
$responder
private
Responder
$responder
$storageDirectory
private
string
$storageDirectory
= __DIR__ . '/../../../data'
$tempDirectory
private
string
$tempDirectory
= __DIR__ . '/../../../tmp/upload'
Methods
__construct()
public
__construct(ReportAdd $reportAdd, Responder $responder) : mixed
Parameters
__invoke()
Action.
public
__invoke(ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
The request
- $response : ResponseInterface
-
The response
Return values
ResponseInterface —The response
moveUploadedFile()
Moves the uploaded file to the upload directory and assigns it a unique name to avoid overwriting an existing uploaded file.
private
moveUploadedFile(string $directory, UploadedFileInterface $uploadedFile) : string
Parameters
- $directory : string
-
The directory to which the file is moved
- $uploadedFile : UploadedFileInterface
-
The file uploaded file to move
Return values
string —The filename of moved file