Class Zend_Validate_File_Count

Description

Validator for counting all given files

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Validate/File/Count.php (line 35)

Zend_Validate_Abstract
   |
   --Zend_Validate_File_Count
Direct descendents
Class Description
 class Zend_Validate_File_WordCount Validator for counting all words in a file
Class Constant Summary
 TOO_FEW = 'fileCountTooFew'
 TOO_MANY = 'fileCountTooMany'
Variable Summary
 integer $_count
 array $_files
 integer|null $_max
 integer $_min
Method Summary
 void __construct (integer|array|Zend_Config $options)
 void addFile (string|array $file)
 integer getMax ()
 integer getMin ()
 boolean isValid (string|array $value, [array $file = null])
 Zend_Validate_StringLength setMax (integer|array $max)
 Zend_Validate_File_Count setMin (integer|array $min)
 false _throw (string $file, string $errorType)
Variables
integer $_count (line 84)

Actual filecount

  • access: protected
array $_files (line 90)

Internal file array

  • access: protected
integer|null $_max (line 77)

Maximum file count

If null, there is no maximum file count

  • access: protected
array $_messageTemplates = 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",
)
(line 47)
  • var: Error message templates
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageTemplates
Validation failure message template definitions

Redefined in descendants as:
array $_messageVariables = array(
'min' => '_min',
'max' => '_max',
'count' => '_count'
)
(line 55)
  • var: Error message template variables
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageVariables
Additional variables available for validation failure messages
integer $_min (line 68)

Minimum file count

If null, there is no minimum file count

  • access: protected

Inherited Variables

Inherited from Zend_Validate_Abstract

Zend_Validate_Abstract::$_defaultTranslator
Zend_Validate_Abstract::$_errors
Zend_Validate_Abstract::$_messageLength
Zend_Validate_Abstract::$_messages
Zend_Validate_Abstract::$_obscureValue
Zend_Validate_Abstract::$_translator
Zend_Validate_Abstract::$_translatorDisabled
Zend_Validate_Abstract::$_value
Methods
Constructor __construct (line 106)

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

  • access: public
void __construct (integer|array|Zend_Config $options)
  • integer|array|Zend_Config $options: Options for the adapter
addFile (line 214)

Adds a file for validation

  • access: public
void addFile (string|array $file)
  • string|array $file
getMax (line 175)

Returns the maximum file count

  • access: public
integer getMax ()
getMin (line 136)

Returns the minimum file count

  • access: public
integer getMin ()
isValid (line 242)

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.

  • access: public
boolean isValid (string|array $value, [array $file = null])
  • string|array $value: Filenames to check for count
  • array $file: File data from Zend_File_Transfer

Redefined in descendants as:
setMax (line 187)

Sets the maximum file count

  • return: Provides a fluent interface
  • throws: Zend_Validate_Exception When max is smaller than min
  • access: public
Zend_Validate_StringLength setMax (integer|array $max)
  • integer|array $max: The maximum file count
setMin (line 148)

Sets the minimum file count

  • return: Provides a fluent interface
  • throws: Zend_Validate_Exception When min is greater than max
  • access: public
Zend_Validate_File_Count setMin (integer|array $min)
  • integer|array $min: The minimum file count
_throw (line 275)

Throws an error of the given type

  • access: protected
false _throw (string $file, string $errorType)
  • string $file
  • string $errorType

Redefined in descendants as:

Inherited Methods

Inherited From Zend_Validate_Abstract

 Zend_Validate_Abstract::getDefaultTranslator()
 Zend_Validate_Abstract::getErrors()
 Zend_Validate_Abstract::getMessageLength()
 Zend_Validate_Abstract::getMessages()
 Zend_Validate_Abstract::getMessageTemplates()
 Zend_Validate_Abstract::getMessageVariables()
 Zend_Validate_Abstract::getObscureValue()
 Zend_Validate_Abstract::getTranslator()
 Zend_Validate_Abstract::hasDefaultTranslator()
 Zend_Validate_Abstract::hasTranslator()
 Zend_Validate_Abstract::setDefaultTranslator()
 Zend_Validate_Abstract::setDisableTranslator()
 Zend_Validate_Abstract::setMessage()
 Zend_Validate_Abstract::setMessageLength()
 Zend_Validate_Abstract::setMessages()
 Zend_Validate_Abstract::setObscureValue()
 Zend_Validate_Abstract::setTranslator()
 Zend_Validate_Abstract::translatorIsDisabled()
 Zend_Validate_Abstract::_createMessage()
 Zend_Validate_Abstract::_error()
 Zend_Validate_Abstract::_setValue()
 Zend_Validate_Abstract::__get()
Class Constants
TOO_FEW = 'fileCountTooFew' (line 41)
TOO_MANY = 'fileCountTooMany' (line 40)

Documentation generated on Mon, 21 Jun 2010 15:14:29 -0400 by phpDocumentor 1.4.3