Validator for counting all words in a file
category | Zend |
---|---|
package | Zend_Validate |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Validate_File_Count |
__construct(integer|array|\Zend_Config $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 for the adapter
\Zend_Validate_Exception |
---|
__get(string $property) : mixed
string
\Zend_Validate_Exception |
---|
mixed
addFile(string|array $file) : \Zend_Validate_File_WordCount
fluent | This method is part of a fluent interface and will return the same instance |
---|
string
array
\Zend_Validate_File_WordCount
getDefaultTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
getErrors() : array
deprecated | Since 1.5.0 |
---|
array
getMax() : integer
integer
getMessageLength() : integer
integer
getMessageTemplates() : array
array
getMessageVariables() : array
array
getMessages() : array
If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.
inherited_from | \Zend_Validate_Interface::getMessages() |
---|
array
getMin() : integer
integer
getObscureValue() : boolean
boolean
getTranslator() : \Zend_Translate_Adapter | null
\Zend_Translate_Adapter
null
hasDefaultTranslator() : boolean
boolean
hasTranslator() : boolean
boolean
isValid(string $value, array $file = null
) : boolean
Returns true if and only if the counted words are at least min and not bigger than max (when max is not null).
inherited_from | \Zend_Validate_File_Count::isValid() |
---|
string
Filename to check for word count
array
File data from Zend_File_Transfer
boolean
isValid(string|array $value, array $file = null
) : boolean
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
Filenames to check for count
array
File data from Zend_File_Transfer
boolean
setDefaultTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
)
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Validate_Exception |
---|
setDisableTranslator(boolean $flag) : \Zend_Validate_Abstract
boolean
\Zend_Validate_Abstract
setMax(integer|array $max) : \Zend_Validate_StringLength
integer
array
The maximum file count
\Zend_Validate_Exception |
When max is smaller than min |
---|
\Zend_Validate_StringLength
Provides a fluent interfacesetMessage(string $messageString, string $messageKey = null
) : \Zend_Validate_Abstract
string
string
OPTIONAL
\Zend_Validate_Exception |
---|
\Zend_Validate_Abstract
Provides a fluent interfacesetMessageLength(integer $length = -1
)
integer
setMessages(array $messages) : \Zend_Validate_Abstract
array
\Zend_Validate_Abstract
setMin(integer|array $min) : \Zend_Validate_File_Count
integer
array
The minimum file count
\Zend_Validate_Exception |
When min is greater than max |
---|
\Zend_Validate_File_Count
Provides a fluent interfacesetObscureValue(boolean $flag) : \Zend_Validate_Abstract
boolean
\Zend_Validate_Abstract
setTranslator(\Zend_Translate|\Zend_Translate_Adapter|null $translator = null
) : \Zend_Validate_Abstract
\Zend_Translate
\Zend_Translate_Adapter
null
\Zend_Validate_Exception |
---|
\Zend_Validate_Abstract
translatorIsDisabled() : boolean
boolean
_createMessage(string $messageKey, string $value) : string
Returns null if and only if $messageKey does not correspond to an existing template.
If a translator is available and a translation exists for $messageKey, the translation will be used.
string
string
string
_error(string $messageKey, string $value = null
) : void
string
string
OPTIONAL
_implodeRecursive(array $pieces) : string
array
string
_setValue(mixed $value) : void
mixed
_throw(string $file, string $errorType) : false
inherited_from | \Zend_Validate_File_Count::_throw() |
---|
string
string
false
_throw(string $file, string $errorType) : false
string
string
false
$_count : integer
$_defaultTranslator : \Zend_Translate
$_errors : array
array()
deprecated | Since 1.5.0 |
---|
$_files : array
$_max : integer | null
If null, there is no maximum file count
$_min : integer
If null, there is no minimum file count
$_obscureValue : boolean
false
$_translator : \Zend_Translate
$_translatorDisabled : Boolean
false
$_value : mixed
NOT_FOUND = 'fileWordCountNotFound'
TOO_FEW = 'fileCountTooFew'
TOO_LESS = 'fileWordCountTooLess'
TOO_MANY = 'fileCountTooMany'
TOO_MUCH = 'fileWordCountTooMuch'