Class Zend_Validate_File_Extension

Description

Validator for the file extension of a file

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

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

Zend_Validate_Abstract
   |
   --Zend_Validate_File_Extension
Direct descendents
Class Description
 class Zend_Validate_File_ExcludeExtension Validator for the excluding file extensions
Class Constant Summary
 FALSE_EXTENSION = 'fileExtensionFalse'
 NOT_FOUND = 'fileExtensionNotFound'
Variable Summary
Method Summary
 void __construct (string|array|Zend_Config $options)
 Zend_Validate_File_Extension addExtension (string|array $extension)
 boolean getCase ()
 array getExtension ()
 boolean isValid (string $value, [array $file = null])
 Zend_Validate_File_Extension setExtension (string|array $extension)
 false _throw (string $file, string $errorType)
Variables
boolean $_case = false (line 62)

Validate case sensitive

  • access: protected
string $_extension = '' (line 55)

Internal list of extensions

  • access: protected
array $_messageTemplates = array(
self::FALSE_EXTENSION => "File '%value%' has a false extension",
self::NOT_FOUND => "File '%value%' could not be found",
)
(line 46)
  • var: Error message templates
  • access: protected

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

Redefined in descendants as:
array $_messageVariables = array(
'extension' => '_extension'
)
(line 67)
  • var: Error message template variables
  • access: protected

Redefinition of:
Zend_Validate_Abstract::$_messageVariables
Additional variables available for validation failure messages

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 77)

Sets validator options

  • access: public
void __construct (string|array|Zend_Config $options)
addExtension (line 149)

Adds the file extensions

  • return: Provides a fluent interface
  • access: public
Zend_Validate_File_Extension addExtension (string|array $extension)
  • string|array $extension: The extensions to add for validation
getCase (line 101)

Returns the case option

  • access: public
boolean getCase ()
getExtension (line 123)

Returns the set file extension

  • access: public
array getExtension ()
isValid (line 187)

Defined by Zend_Validate_Interface

Returns true if and only if the fileextension of $value is included in the set extension list

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

Redefined in descendants as:
setCase (line 112)

Sets the case to use

  • return: Provides a fluent interface
  • access: public
Zend_Validate_File_Extension setCase (boolean $case)
  • boolean $case
setExtension (line 136)

Sets the file extensions

  • return: Provides a fluent interface
  • access: public
Zend_Validate_File_Extension setExtension (string|array $extension)
  • string|array $extension: The extensions to validate
_throw (line 223)

Throws an error of the given type

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

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
FALSE_EXTENSION = 'fileExtensionFalse' (line 40)
NOT_FOUND = 'fileExtensionNotFound' (line 41)

Documentation generated on Mon, 21 Jun 2010 15:22:02 -0400 by phpDocumentor 1.4.3