|
Moodle
2.2.1
http://www.collinsharper.com
|


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 | |
| __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
| integer | array | Zend_Config | $options | Options for the adapter |
Definition at line 106 of file Count.php.

| _throw | ( | $ | file, |
| $ | errorType | ||
| ) | [protected] |
Throws an error of the given type
| string | $file | |
| string | $errorType |
Reimplemented in Zend_Validate_File_WordCount.
Definition at line 275 of file Count.php.


| addFile | ( | $ | file | ) |
| 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.
| string | array | $value | Filenames to check for count |
| array | $file | File data from Zend_File_Transfer |
Reimplemented in Zend_Validate_File_WordCount.
Definition at line 242 of file Count.php.

| setMax | ( | $ | max | ) |
Sets the maximum file count
| integer | array | $max | The maximum file count |
| Zend_Validate_Exception | When max is smaller than min |
Definition at line 187 of file Count.php.

| setMin | ( | $ | min | ) |
Sets the minimum file count
| integer | array | $min | The minimum file count |
| Zend_Validate_Exception | When min is greater than max |
Definition at line 148 of file Count.php.

$_messageTemplates [protected] |
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.
$_messageVariables [protected] |
array( 'min' => '_min', 'max' => '_max', 'count' => '_count' )
Reimplemented from Zend_Validate_Abstract.
| const TOO_MANY = 'fileCountTooMany' |