Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_File_Count Class Reference
Inheritance diagram for Zend_Validate_File_Count:
Collaboration diagram for Zend_Validate_File_Count:

Public Member Functions

 __construct ($options)
 getMin ()
 setMin ($min)
 getMax ()
 setMax ($max)
 addFile ($file)
 isValid ($value, $file=null)

Data Fields

const TOO_MANY = 'fileCountTooMany'
const TOO_FEW = 'fileCountTooFew'

Protected Member Functions

 _throw ($file, $errorType)

Protected Attributes

 $_messageTemplates
 $_messageVariables
 $_min
 $_max
 $_count
 $_files

Detailed Description

Definition at line 35 of file Count.php.


Constructor & Destructor Documentation

__construct ( options)

Sets validator options

Min limits the file count, when used with max=null it is the maximum file count It also accepts an array with the keys 'min' and 'max'

If $options is a integer, it will be used as maximum file count As Array is accepts the following keys: 'min': Minimum filecount 'max': Maximum filecount

Parameters:
integer | array | Zend_Config$optionsOptions for the adapter
Returns:
void

Definition at line 106 of file Count.php.

Here is the call graph for this function:


Member Function Documentation

_throw ( file,
errorType 
) [protected]

Throws an error of the given type

Parameters:
string$file
string$errorType
Returns:
false

Reimplemented in Zend_Validate_File_WordCount.

Definition at line 275 of file Count.php.

Here is the call graph for this function:

Here is the caller graph for this function:

addFile ( file)

Adds a file for validation

Parameters:
string | array$file

Definition at line 214 of file Count.php.

Here is the caller graph for this function:

getMax ( )

Returns the maximum file count

Returns:
integer

Definition at line 175 of file Count.php.

getMin ( )

Returns the minimum file count

Returns:
integer

Definition at line 136 of file Count.php.

isValid ( value,
file = null 
)

Defined by Zend_Validate_Interface

Returns true if and only if the file count of all checked files is at least min and not bigger than max (when max is not null). Attention: When checking with set min you must give all files with the first call, otherwise you will get an false.

Parameters:
string | array$valueFilenames to check for count
array$fileFile data from Zend_File_Transfer
Returns:
boolean

Reimplemented in Zend_Validate_File_WordCount.

Definition at line 242 of file Count.php.

Here is the call graph for this function:

setMax ( max)

Sets the maximum file count

Parameters:
integer | array$maxThe maximum file count
Returns:
Zend_Validate_StringLength Provides a fluent interface
Exceptions:
Zend_Validate_ExceptionWhen max is smaller than min

Definition at line 187 of file Count.php.

Here is the caller graph for this function:

setMin ( min)

Sets the minimum file count

Parameters:
integer | array$minThe minimum file count
Returns:
Zend_Validate_File_Count Provides a fluent interface
Exceptions:
Zend_Validate_ExceptionWhen min is greater than max

Definition at line 148 of file Count.php.

Here is the caller graph for this function:


Field Documentation

$_count [protected]

Definition at line 84 of file Count.php.

$_files [protected]

Definition at line 90 of file Count.php.

$_max [protected]

Definition at line 77 of file Count.php.

$_messageTemplates [protected]
Initial value:
 array(
        self::TOO_MANY => "Too many files, maximum '%max%' are allowed but '%count%' are given",
        self::TOO_FEW  => "Too few files, minimum '%min%' are expected but '%count%' are given",
    )

Reimplemented from Zend_Validate_Abstract.

Reimplemented in Zend_Validate_File_WordCount.

Definition at line 47 of file Count.php.

$_messageVariables [protected]
Initial value:
 array(
        'min'   => '_min',
        'max'   => '_max',
        'count' => '_count'
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 55 of file Count.php.

$_min [protected]

Definition at line 68 of file Count.php.

const TOO_FEW = 'fileCountTooFew'

Definition at line 41 of file Count.php.

const TOO_MANY = 'fileCountTooMany'

#@+ string Error constants

Definition at line 40 of file Count.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations