Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Validator for counting all given files
TOO_MANY = 'fileCountTooMany'
Details TOO_FEW = 'fileCountTooFew'
Detailsinteger $_count = ''Actual filecount
Detailsarray $_files = ''Internal file array
Detailsinteger|null $_max = ''Maximum file count
If null, there is no maximum file count
Detailsarray $_messageTemplates = 'array'
Detailsarray $_messageVariables = 'array'
Detailsinteger $_min = ''Minimum file count
If null, there is no minimum file count
Details__construct(
integer|array|Zend_Config $options
)
:
voidSets 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
Details_throw(
string $file, string $errorType
)
:
falseThrows an error of the given type
DetailsaddFile(
string|array $file
)
:
Adds a file for validation
DetailsgetMax(
)
:
integerReturns the maximum file count
DetailsgetMin(
)
:
integerReturns the minimum file count
DetailsisValid(
string|array $value, array $file
=
null
)
:
booleanDefined 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.
DetailssetMax(
integer|array $max
)
:
Zend_Validate_StringLengthSets the maximum file count
DetailssetMin(
integer|array $min
)
:
Zend_Validate_File_CountSets the minimum file count
Details