Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

Zend_Validate_File_Extension Class Reference

Inheritance diagram for Zend_Validate_File_Extension:
Zend_Validate_Abstract Zend_Validate_Interface Zend_Validate_File_ExcludeExtension

Public Member Functions

 __construct ($options)
 getCase ()
 setCase ($case)
 getExtension ()
 setExtension ($extension)
 addExtension ($extension)
 isValid ($value, $file=null)

Data Fields

const FALSE_EXTENSION = 'fileExtensionFalse'
const NOT_FOUND = 'fileExtensionNotFound'

Protected Member Functions

 _throw ($file, $errorType)

Protected Attributes

 $_messageTemplates
 $_extension = ''
 $_case = false
 $_messageVariables

Detailed Description

Definition at line 35 of file Extension.php.


Constructor & Destructor Documentation

__construct ( options )

Sets validator options

Parameters:
string | array | Zend_Config$options
Returns:
void

Definition at line 77 of file Extension.php.


Member Function Documentation

_throw ( file,
errorType 
) [protected]

Throws an error of the given type

Parameters:
string$file
string$errorType
Returns:
false

Definition at line 225 of file Extension.php.

addExtension ( extension )

Adds the file extensions

Parameters:
string | array$extensionThe extensions to add for validation
Returns:
Zend_Validate_File_Extension Provides a fluent interface

Definition at line 151 of file Extension.php.

getCase (  )

Returns the case option

Returns:
boolean

Definition at line 103 of file Extension.php.

getExtension (  )

Returns the set file extension

Returns:
array

Definition at line 125 of file Extension.php.

isValid ( value,
file = null 
)

Defined by Zend_Validate_Interface

Returns true if and only if the fileextension of $value is included in the set extension list

Parameters:
string$valueReal file to check for extension
array$fileFile data from Zend_File_Transfer
Returns:
boolean

Reimplemented in Zend_Validate_File_ExcludeExtension.

Definition at line 189 of file Extension.php.

setCase ( case )

Sets the case to use

Parameters:
boolean$case
Returns:
Zend_Validate_File_Extension Provides a fluent interface

Definition at line 114 of file Extension.php.

setExtension ( extension )

Sets the file extensions

Parameters:
string | array$extensionThe extensions to validate
Returns:
Zend_Validate_File_Extension Provides a fluent interface

Definition at line 138 of file Extension.php.


Field Documentation

$_messageTemplates [protected]
Initial value:
 array(
        self::FALSE_EXTENSION => "The file '%value%' has a false extension",
        self::NOT_FOUND       => "The file '%value%' was not found"
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 46 of file Extension.php.

$_messageVariables [protected]
Initial value:
 array(
        'extension' => '_extension'
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 67 of file Extension.php.

const FALSE_EXTENSION = 'fileExtensionFalse'

string Error constants

Reimplemented in Zend_Validate_File_ExcludeExtension.

Definition at line 40 of file Extension.php.


The documentation for this class was generated from the following file: