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

Zend_Validate_File_Exists Class Reference

Inheritance diagram for Zend_Validate_File_Exists:
Zend_Validate_Abstract Zend_Validate_Interface Zend_Validate_File_NotExists

Public Member Functions

 __construct ($directory=array())
 getDirectory ($asArray=false)
 setDirectory ($directory)
 addDirectory ($directory)
 isValid ($value, $file=null)

Data Fields

const DOES_NOT_EXIST = 'fileExistsDoesNotExist'

Protected Member Functions

 _throw ($file, $errorType)

Protected Attributes

 $_messageTemplates
 $_directory = ''
 $_messageVariables

Detailed Description

Definition at line 35 of file Exists.php.


Constructor & Destructor Documentation

__construct ( directory = array() )

Sets validator options

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

Definition at line 68 of file Exists.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 194 of file Exists.php.

addDirectory ( directory )

Adds the file directory which will be checked

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

Definition at line 118 of file Exists.php.

getDirectory ( asArray = false )

Returns the set file directories which are checked

Parameters:
boolean$asArrayReturns the values as array, when false an concated string is returned
Returns:
string

Definition at line 88 of file Exists.php.

isValid ( value,
file = null 
)

Defined by Zend_Validate_Interface

Returns true if and only if the file already exists in the set directories

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

Reimplemented in Zend_Validate_File_NotExists.

Definition at line 159 of file Exists.php.

setDirectory ( directory )

Sets the file directory which will be checked

Parameters:
string | array$directoryThe directories to validate
Returns:
Zend_Validate_File_Extension Provides a fluent interface

Definition at line 105 of file Exists.php.


Field Documentation

$_messageTemplates [protected]
Initial value:
 array(
        self::DOES_NOT_EXIST => "The file '%value%' does not exist"
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 45 of file Exists.php.

$_messageVariables [protected]
Initial value:
 array(
        'directory' => '_directory'
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 58 of file Exists.php.

const DOES_NOT_EXIST = 'fileExistsDoesNotExist'

string Error constants

Definition at line 40 of file Exists.php.


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