PHP Class Jyxo\Input\Validator\Upload

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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
isUploaded ( string $file ) : boolean Checks if the file was uploaded.

Private Methods

Méthode Description
setError ( integer $error ) Sets upload errors.

Method Details

filter() public méthode

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

getError() public méthode

Returns error message in case of upload error.
public getError ( ) : string
Résultat string

isUploaded() protected méthode

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

isValid() public méthode

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

requireUpload() public méthode

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