PHP Class Jyxo\Input\Validator\Upload

Author: Jakub Tománek
Inheritance: extends AbstractValidator, implements Jyxo\Input\FilterInterface, implements Jyxo\Input\Validator\ErrorMessage
Datei anzeigen Open project: jyxo/php

Public Methods

Method Description
filter ( Upload $in ) : Upload Sets that the file fas successfully uploaded.
getError ( ) : string Returns error message in case of upload error.
isValid ( Upload | string $file ) : boolean Checks if the file was successfully uploaded.
requireUpload ( boolean $flag = true ) : self Sets if a file is required to be uploaded.

Protected Methods

Method Description
isUploaded ( string $file ) : boolean Checks if the file was uploaded.

Private Methods

Method Description
setError ( integer $error ) Sets upload errors.

Method Details

filter() public method

Sets that the file fas successfully uploaded.
public filter ( Upload $in ) : Upload
$in Jyxo\Input\Upload Uploaded file
return Jyxo\Input\Upload

getError() public method

Returns error message in case of upload error.
public getError ( ) : string
return string

isUploaded() protected method

Checks if the file was uploaded.
protected isUploaded ( string $file ) : boolean
$file string File index in the $_FILES array
return boolean

isValid() public method

Checks if the file was successfully uploaded.
public isValid ( Upload | string $file ) : boolean
$file Jyxo\Input\Upload | string File index in the $_FILES array
return boolean

requireUpload() public method

Sets if a file is required to be uploaded.
public requireUpload ( boolean $flag = true ) : self
$flag boolean Does the file have to be uploaded
return self