Form/Element/File.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Form  

\Zend_Form_Element_File

Package: Zend\Form\Element
Zend_Form_Element
Parent(s)
\Zend_Form_Element_Xhtml < \Zend_Form_Element
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id: File.php 25225 2013-01-17 15:59:16Z frosch $  

Constants

>VConstant  TRANSFER_ADAPTER = 'TRANSFER_ADAPTER'
Plugin loader type
>VConstant  DECORATOR = 'DECORATOR'
>VConstant  FILTER = 'FILTER'
>VConstant  VALIDATE = 'VALIDATE'

Properties

>VPropertyprotected\Zend_File_Transfer_Adapter_Abstract $_adapter
>VPropertyprotectedbool $_allowEmpty = true
Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_allowEmpty  
Inherited_from
\Zend_Form_Element_Xhtml::$$_allowEmpty  
>VPropertyprotectedbool $_autoInsertNotEmptyValidator = true
inherited
Flag indicating whether or not to insert NotEmpty validator when element is required
Inherited from: \Zend_Form_Element::$$_autoInsertNotEmptyValidator\Zend_Form_Element_Xhtml::$$_autoInsertNotEmptyValidator
>VPropertyprotectedstring $_belongsTo
inherited
Array to which element belongs
Inherited from: \Zend_Form_Element::$$_belongsTo\Zend_Form_Element_Xhtml::$$_belongsTo
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_belongsTo  
Inherited_from
\Zend_Form_Element_Xhtml::$$_belongsTo  
>VPropertyprotectedinteger $_counter = 1

Internal multifile counter

Default value1Details
Type
integer
>VPropertyprotectedarray $_decorators = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_decorators  
Inherited_from
\Zend_Form_Element_Xhtml::$$_decorators  
>VPropertyprotectedstring $_description
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_description  
Inherited_from
\Zend_Form_Element_Xhtml::$$_description  
>VPropertyprotectedbool $_disableLoadDefaultDecorators = false
inherited
Should we disable loading the default decorators?
Inherited from: \Zend_Form_Element::$$_disableLoadDefaultDecorators\Zend_Form_Element_Xhtml::$$_disableLoadDefaultDecorators
>VPropertyprotectedstring $_errorMessageSeparator = '; '
inherited
Separator to use when concatenating aggregate error messages (for elements having array values)
Inherited from: \Zend_Form_Element::$$_errorMessageSeparator\Zend_Form_Element_Xhtml::$$_errorMessageSeparator
Default value'; 'Details
Type
string
Inherited_from
\Zend_Form_Element::$$_errorMessageSeparator  
Inherited_from
\Zend_Form_Element_Xhtml::$$_errorMessageSeparator  
>VPropertyprotectedarray $_errorMessages = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_errorMessages  
Inherited_from
\Zend_Form_Element_Xhtml::$$_errorMessages  
>VPropertyprotectedarray $_errors = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_errors  
Inherited_from
\Zend_Form_Element_Xhtml::$$_errors  
>VPropertyprotectedarray $_filters = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_filters  
Inherited_from
\Zend_Form_Element_Xhtml::$$_filters  
>VPropertyprotectedbool $_ignore = false
inherited
Ignore flag (used when retrieving values at form level)
Inherited from: \Zend_Form_Element::$$_ignore\Zend_Form_Element_Xhtml::$$_ignore
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_ignore  
Inherited_from
\Zend_Form_Element_Xhtml::$$_ignore  
>VPropertyprotectedbool $_isArray = false
inherited
Does the element represent an array?
Inherited from: \Zend_Form_Element::$$_isArray\Zend_Form_Element_Xhtml::$$_isArray
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_isArray  
Inherited_from
\Zend_Form_Element_Xhtml::$$_isArray  
>VPropertyprotectedbool $_isError = false
inherited
Is the error marked as in an invalid state?
Inherited from: \Zend_Form_Element::$$_isError\Zend_Form_Element_Xhtml::$$_isError
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_isError  
Inherited_from
\Zend_Form_Element_Xhtml::$$_isError  
>VPropertyprotectedbool $_isErrorForced = false
inherited
Has the element been manually marked as invalid?
Inherited from: \Zend_Form_Element::$$_isErrorForced\Zend_Form_Element_Xhtml::$$_isErrorForced
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_isErrorForced  
Inherited_from
\Zend_Form_Element_Xhtml::$$_isErrorForced  
>VPropertyprotectedbool $_isPartialRendering = false
inherited
Is a specific decorator being rendered via the magic renderDecorator()?
Inherited from: \Zend_Form_Element::$$_isPartialRendering\Zend_Form_Element_Xhtml::$$_isPartialRendering

This is to allow execution of logic inside the render() methods of child elements during the magic call while skipping the parent render() method.

Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_isPartialRendering  
Inherited_from
\Zend_Form_Element_Xhtml::$$_isPartialRendering  
>VPropertyprotectedstring $_label
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_label  
Inherited_from
\Zend_Form_Element_Xhtml::$$_label  
>VPropertyprotectedarray $_loaders = array()
inherited
Plugin loaders for filter and validator chains
Inherited from: \Zend_Form_Element::$$_loaders\Zend_Form_Element_Xhtml::$$_loaders
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_loaders  
Inherited_from
\Zend_Form_Element_Xhtml::$$_loaders  
>VPropertyprotectedinteger $_maxFileSize = -1
static

Maximum file size for MAX_FILE_SIZE attribut of form

Default value-1Details
Type
integer
>VPropertyprotectedarray $_messages = array()
inherited
Formatted validation error messages
Inherited from: \Zend_Form_Element::$$_messages\Zend_Form_Element_Xhtml::$$_messages
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_messages  
Inherited_from
\Zend_Form_Element_Xhtml::$$_messages  
>VPropertyprotectedstring $_name
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_name  
Inherited_from
\Zend_Form_Element_Xhtml::$$_name  
>VPropertyprotectedint $_order
Details
Type
int
Inherited_from
\Zend_Form_Element::$$_order  
Inherited_from
\Zend_Form_Element_Xhtml::$$_order  
>VPropertyprotectedbool $_required = false
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_required  
Inherited_from
\Zend_Form_Element_Xhtml::$$_required  
>VPropertyprotectedbool $_translatorDisabled = false
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_translatorDisabled  
Inherited_from
\Zend_Form_Element_Xhtml::$$_translatorDisabled  
>VPropertyprotectedstring $_type
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_type  
Inherited_from
\Zend_Form_Element_Xhtml::$$_type  
>VPropertyprotectedboolean $_validated = false

Already validated ?

Default valuefalseDetails
Type
boolean
>VPropertyprotectedarray $_validatorRules = array()
inherited
Array of un-initialized validators
Inherited from: \Zend_Form_Element::$$_validatorRules\Zend_Form_Element_Xhtml::$$_validatorRules
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_validatorRules  
Inherited_from
\Zend_Form_Element_Xhtml::$$_validatorRules  
>VPropertyprotectedarray $_validators = array()
inherited
Array of initialized validators
Inherited from: \Zend_Form_Element::$$_validators\Zend_Form_Element_Xhtml::$$_validators
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_validators  
Inherited_from
\Zend_Form_Element_Xhtml::$$_validators  
>VPropertyprotectedmixed $_value
Details
Type
mixed
Inherited_from
\Zend_Form_Element::$$_value  
Inherited_from
\Zend_Form_Element_Xhtml::$$_value  
>VPropertyprotectedboolean $_valueDisabled = false

Disable value to be equal to file content

Default valuefalseDetails
Type
boolean
>VPropertyprotected\Zend_View_Interface $_view
>VPropertypublicstring $helper = 'formFile'
Default view helper to use
Default value'formFile'Details
Type
string

Methods

methodpublic__call(string $method, array $args) : string
inherited

Overloading: allow rendering specific decorators

Inherited from: \Zend_Form_Element::__call()\Zend_Form_Element_Xhtml::__call()

Call renderDecoratorName() to render a specific decorator.

Parameters
NameTypeDescription
$methodstring
$argsarray
Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Form_Exceptionfor invalid decorator or invalid method call
methodpublic__construct(string | array | \Zend_Config $spec, array | \Zend_Config $options = null) : void

$spec may be: - string: name of element - array: options with which to configure element - Zend_Config: Zend_Config with options for configuring element

Parameters
NameTypeDescription
$specstring | array | \Zend_Config
$optionsarray | \Zend_Config
Throws
ExceptionDescription
\Zend_Form_Exceptionif no element name after initialization
methodpublic__get(string $key) : mixed
inherited

Overloading: retrieve object property

Inherited from: \Zend_Form_Element::__get()\Zend_Form_Element_Xhtml::__get()

Prevents access to properties beginning with '_'.

Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
mixed
methodpublic__set(string $key, mixed $value) : \voide
inherited

Overloading: set object property

Inherited from: \Zend_Form_Element::__set()\Zend_Form_Element_Xhtml::__set()
Parameters
NameTypeDescription
$keystring
$valuemixed
Returns
TypeDescription
\voide
methodpublic__toString() : string
inherited

String representation of form element

Inherited from: \Zend_Form_Element::__toString()\Zend_Form_Element_Xhtml::__toString()

Proxies to render().

Returns
TypeDescription
string
methodprivate_convertIniToInteger(string $setting) : integer

Converts a ini setting to a integer value

Parameters
NameTypeDescription
$settingstring
Returns
TypeDescription
integer
methodprotected_filterValue(string $value, string $key) : void
Parameters
NameTypeDescription
$valuestring
$keystring
methodprotected_getDecorator(string $name, null | array $options) : \Zend_Form_Decorator_Interface
inherited

Instantiate a decorator based on class name or class name fragment

Inherited from: \Zend_Form_Element::_getDecorator()\Zend_Form_Element_Xhtml::_getDecorator()
Parameters
NameTypeDescription
$namestring
$optionsnull | array
Returns
TypeDescription
\Zend_Form_Decorator_Interface
methodprotected_getErrorMessages() : array

Retrieve error messages and perform translation and value substitution

Returns
TypeDescription
array
methodprotected_hasErrorMessages() : bool
inherited

Are there custom error messages registered?

Inherited from: \Zend_Form_Element::_hasErrorMessages()\Zend_Form_Element_Xhtml::_hasErrorMessages()
Returns
TypeDescription
bool
methodprotected_loadDecorator(array $decorator, mixed $name) : \Zend_Form_Decorator_Interface
Parameters
NameTypeDescription
$decoratorarray

Decorator type and options

$namemixed

Decorator name or alias

Returns
TypeDescription
\Zend_Form_Decorator_Interface
methodprotected_loadFilter(array $filter) : \Zend_Filter_Interface
Parameters
NameTypeDescription
$filterarray
Returns
TypeDescription
\Zend_Filter_Interface
methodprotected_loadValidator(array $validator) : \Zend_Validate_Interface
Parameters
NameTypeDescription
$validatorarray

Validator definition

Returns
TypeDescription
\Zend_Validate_Interface
methodpublicaddDecorator(string | \Zend_Form_Decorator_Interface $decorator, array | \Zend_Config $options = null) : \Zend_Form_Element
inherited

Add a decorator for rendering the element

Inherited from: \Zend_Form_Element::addDecorator()\Zend_Form_Element_Xhtml::addDecorator()
Parameters
NameTypeDescription
$decoratorstring | \Zend_Form_Decorator_Interface
$optionsarray | \Zend_Config

Options with which to initialize decorator

Returns
TypeDescription
\Zend_Form_Element
methodpublicaddDecorators(array $decorators) : \Zend_Form_Element
inherited

Add many decorators at once

Inherited from: \Zend_Form_Element::addDecorators()\Zend_Form_Element_Xhtml::addDecorators()
Parameters
NameTypeDescription
$decoratorsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddError(string $message) : \Zend_Form_Element
inherited

Add an error message and mark element as failed validation

Inherited from: \Zend_Form_Element::addError()\Zend_Form_Element_Xhtml::addError()
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddErrorMessage(string $message) : \Zend_Form_Element
inherited

Add a custom error message to return in the event of failed validation

Inherited from: \Zend_Form_Element::addErrorMessage()\Zend_Form_Element_Xhtml::addErrorMessage()
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddErrorMessages(array $messages) : \Zend_Form_Element
inherited

Add multiple custom error messages to return in the event of failed validation

Inherited from: \Zend_Form_Element::addErrorMessages()\Zend_Form_Element_Xhtml::addErrorMessages()
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddErrors(array $messages) : \Zend_Form_Element
inherited

Add multiple error messages and flag element as failed validation

Inherited from: \Zend_Form_Element::addErrors()\Zend_Form_Element_Xhtml::addErrors()
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddFilter(string | array $filter, string | array $options = null) : \Zend_Form_Element_File

Add Filter; proxy to adapter

Parameters
NameTypeDescription
$filterstring | array

Type of filter to add

$optionsstring | array

Options to set for the filter

Returns
TypeDescription
\Zend_Form_Element_File
methodpublicaddFilters(array $filters) : \Zend_Form_Element_File

Add Multiple filters at once; proxy to adapter

Parameters
NameTypeDescription
$filtersarray
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicaddPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_Element_File

Add prefix path for plugin loader

If no $type specified, assumes it is a base path for both filters and validators, and sets each according to the following rules: - decorators: $prefix = $prefix . '_Decorator' - filters: $prefix = $prefix . '_Filter' - validators: $prefix = $prefix . '_Validate'

Otherwise, the path prefix is set on the appropriate plugin loader.

Parameters
NameTypeDescription
$prefixstring
$pathstring
$typestring
Returns
TypeDescription
\Zend_Form_Element_File
Throws
ExceptionDescription
\Zend_Form_Exceptionfor invalid type
methodpublicaddPrefixPaths(array $spec) : \Zend_Form_Element
inherited

Add many prefix paths at once

Inherited from: \Zend_Form_Element::addPrefixPaths()\Zend_Form_Element_Xhtml::addPrefixPaths()
Parameters
NameTypeDescription
$specarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddValidator(string | \Zend_Validate_Interface $validator, bool $breakChainOnFailure = false, mixed $options = array()) : \Zend_Form_Element_File

Add Validator; proxy to adapter

Note: will overwrite existing validators if they are of the same class.

Parameters
NameTypeDescription
$validatorstring | \Zend_Validate_Interface
$breakChainOnFailurebool
$optionsmixed
Returns
TypeDescription
\Zend_Form_Element_File
Throws
ExceptionDescription
\Zend_Form_Exceptionif invalid validator type
methodpublicaddValidators(array $validators) : \Zend_Form_Element_File

Add multiple validators at once; proxy to adapter

Parameters
NameTypeDescription
$validatorsarray
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicautoInsertNotEmptyValidator() : bool
inherited

Get flag indicating whether a NotEmpty validator should be inserted when element is required

Inherited from: \Zend_Form_Element::autoInsertNotEmptyValidator()\Zend_Form_Element_Xhtml::autoInsertNotEmptyValidator()
Returns
TypeDescription
bool
methodpublicclearDecorators() : \Zend_Form_Element
Returns
TypeDescription
\Zend_Form_Element
methodpublicclearErrorMessages() : \Zend_Form_Element
inherited

Clear custom error messages stack

Inherited from: \Zend_Form_Element::clearErrorMessages()\Zend_Form_Element_Xhtml::clearErrorMessages()
Returns
TypeDescription
\Zend_Form_Element
methodpublicclearFilters() : \Zend_Form_Element_File

Remove all filters; proxy to adapter

Returns
TypeDescription
\Zend_Form_Element_File
methodpublicclearValidators() : \Zend_Form_Element_File

Remove all validators; proxy to adapter

Returns
TypeDescription
\Zend_Form_Element_File
methodpublicfilterName(string $value, bool $allowBrackets = false) : string
inherited

Filter a name to only allow valid variable characters

Inherited from: \Zend_Form_Element::filterName()\Zend_Form_Element_Xhtml::filterName()
Parameters
NameTypeDescription
$valuestring
$allowBracketsbool
Returns
TypeDescription
string
methodpublicgetAllowEmpty() : bool
Returns
TypeDescription
bool
methodpublicgetAttrib(string $name) : string
inherited

Retrieve element attribute

Inherited from: \Zend_Form_Element::getAttrib()\Zend_Form_Element_Xhtml::getAttrib()
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
string
methodpublicgetAttribs() : array
Returns
TypeDescription
array
methodpublicgetBelongsTo() : string
inherited

Return array name to which element belongs

Inherited from: \Zend_Form_Element::getBelongsTo()\Zend_Form_Element_Xhtml::getBelongsTo()
Returns
TypeDescription
string
methodpublicgetDecorator(string $name) : false | \Zend_Form_Decorator_Abstract
inherited

Retrieve a registered decorator

Inherited from: \Zend_Form_Element::getDecorator()\Zend_Form_Element_Xhtml::getDecorator()
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
false | \Zend_Form_Decorator_Abstract
methodpublicgetDecorators() : array
Returns
TypeDescription
array
methodpublicgetDescription() : string
inherited

Retrieve element description

Inherited from: \Zend_Form_Element::getDescription()\Zend_Form_Element_Xhtml::getDescription()
Returns
TypeDescription
string
methodpublicgetDestination() : string

Get the upload destination

Returns
TypeDescription
string
methodpublicgetErrorMessageSeparator() : string
Returns
TypeDescription
string
methodpublicgetErrorMessages() : array
inherited

Retrieve custom error messages

Inherited from: \Zend_Form_Element::getErrorMessages()\Zend_Form_Element_Xhtml::getErrorMessages()
Returns
TypeDescription
array
methodpublicgetErrors() : array

Retrieve error codes; proxy to transfer adapter

Returns
TypeDescription
array
methodpublicgetFileInfo(string $value = null) : array

Get internal file informations

Parameters
NameTypeDescription
$valuestring

(Optional) Element or file to return

Returns
TypeDescription
array
methodpublicgetFileName(string $value = null, boolean $path = true) : string

Get the final filename

Parameters
NameTypeDescription
$valuestring

(Optional) Element or file to return

$pathboolean

(Optional) Return also the path, defaults to true

Returns
TypeDescription
string
methodpublicgetFileSize() : string | array

Returns the filesize for this file element

Returns
TypeDescription
string | arrayFilesize
methodpublicgetFilter(string $name) : \Zend_Filter_Interface | null

Retrieve individual filter; proxy to adapter

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Filter_Interface | null
methodpublicgetFilters() : array

Returns all set filters; proxy to adapter

Returns
TypeDescription
arrayList of set filters
methodpublicgetFullyQualifiedName() : string

Places name as subitem of array and/or appends brackets.

Returns
TypeDescription
string
methodpublicgetHash(string $hash = 'crc32') : string | array

Returns the hash for this file element

Parameters
NameTypeDescription
$hashstring

(Optional) Hash algorithm to use

Returns
TypeDescription
string | arrayHashstring
methodpublicgetId() : string
Returns
TypeDescription
string
methodpublicgetIgnore() : bool
inherited

Get ignore flag (used when retrieving values at form level)

Inherited from: \Zend_Form_Element::getIgnore()\Zend_Form_Element_Xhtml::getIgnore()
Returns
TypeDescription
bool
methodpublicgetLabel() : string
inherited

Retrieve element label

Inherited from: \Zend_Form_Element::getLabel()\Zend_Form_Element_Xhtml::getLabel()
Returns
TypeDescription
string
methodpublicgetMaxFileSize() : integer

Sets the maximum file size of the form

Returns
TypeDescription
integer
methodpublicgetMessages() : array

Retrieve error messages; proxy to transfer adapter

The array keys are validation failure message identifiers, and the array values are the corresponding human-readable message strings.

If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.

Returns
TypeDescription
array
methodpublicgetMimeType() : string | array

Returns the mimetype for this file element

Returns
TypeDescription
string | arrayMimetype
methodpublicgetMultiFile() : integer

Returns the multifile element number

Returns
TypeDescription
integer
methodpublicgetName() : string
inherited

Return element name

Inherited from: \Zend_Form_Element::getName()\Zend_Form_Element_Xhtml::getName()
Returns
TypeDescription
string
methodpublicgetOrder() : int
inherited

Retrieve element order

Inherited from: \Zend_Form_Element::getOrder()\Zend_Form_Element_Xhtml::getOrder()
Returns
TypeDescription
int
methodpublicgetPluginLoader(string $type) : \Zend_Loader_PluginLoader_Interface

Get Plugin Loader

Instantiates with default rules if none available for that type. Use 'decorator', 'filter', or 'validate' for $type.

Parameters
NameTypeDescription
$typestring
Returns
TypeDescription
\Zend_Loader_PluginLoader_Interface
Throws
ExceptionDescription
\Zend_Loader_Exceptionon invalid type.
methodpublicgetTransferAdapter() : \Zend_File_Transfer_Adapter_Abstract

Get transfer adapter

Lazy loads HTTP transfer adapter when no adapter registered.

Returns
TypeDescription
\Zend_File_Transfer_Adapter_Abstract
methodpublicgetTranslator() : \Zend_Translate_Adapter | null

Retrieve localization translator object

Returns
TypeDescription
\Zend_Translate_Adapter | null
methodpublicgetType() : string
inherited

Return element type

Inherited from: \Zend_Form_Element::getType()\Zend_Form_Element_Xhtml::getType()
Returns
TypeDescription
string
methodpublicgetUnfilteredValue() : mixed
inherited

Retrieve unfiltered element value

Inherited from: \Zend_Form_Element::getUnfilteredValue()\Zend_Form_Element_Xhtml::getUnfilteredValue()
Returns
TypeDescription
mixed
methodpublicgetValidator(string $name) : \Zend_Validate_Interface | null

Retrieve validator by name; proxy to adapter

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Validate_Interface | null
methodpublicgetValidators() : array

Retrieve all validators; proxy to adapter

Returns
TypeDescription
array
methodpublicgetValue() : null | string

Processes the file, returns null or the filename only For the complete path, use getFileName

Returns
TypeDescription
null | string
methodpublicgetView() : null | \Zend_View_Interface
inherited

Retrieve view object

Inherited from: \Zend_Form_Element::getView()\Zend_Form_Element_Xhtml::getView()

Retrieves from ViewRenderer if none previously set.

Returns
TypeDescription
null | \Zend_View_Interface
methodpublichasErrors() : bool

Are there errors registered?

Returns
TypeDescription
bool
methodpublichasTranslator() : bool
inherited

Does this element have its own specific translator?

Inherited from: \Zend_Form_Element::hasTranslator()\Zend_Form_Element_Xhtml::hasTranslator()
Returns
TypeDescription
bool
methodpublicinit() : void
inherited

Initialize object; used by extending classes

Inherited from: \Zend_Form_Element::init()\Zend_Form_Element_Xhtml::init()
methodpublicisArray() : bool
inherited

Is the element representing an array?

Inherited from: \Zend_Form_Element::isArray()\Zend_Form_Element_Xhtml::isArray()
Returns
TypeDescription
bool
methodpublicisFiltered() : bool

Has the file been filtered?

Returns
TypeDescription
bool
methodpublicisReceived() : bool

Was the file received?

Returns
TypeDescription
bool
methodpublicisRequired() : bool
inherited

Is the element required?

Inherited from: \Zend_Form_Element::isRequired()\Zend_Form_Element_Xhtml::isRequired()
Returns
TypeDescription
bool
methodpublicisUploaded() : bool

Was the file uploaded?

Returns
TypeDescription
bool
methodpublicisValid(string $value, mixed $context = null) : bool

Validate upload

If a translation adapter is registered, any error messages will be translated according to the current locale, using the given error code; if no matching translation is found, the original message will be utilized.

Note: The filtered value is validated.

Parameters
NameTypeDescription
$valuestring

File, can be optional, give null to validate all files

$contextmixed
Returns
TypeDescription
bool
Throws
ExceptionDescription
\Zend_Validate_ExceptionIf validation of $value is impossible
methodpublicisValueDisabled() : boolean

Returns if the file will be uploaded when calling getValues()

Returns
TypeDescription
booleanReceive the file on calling getValues()?
methodpublicloadDefaultDecorators() : \Zend_Form_Element_File

Load default decorators

Returns
TypeDescription
\Zend_Form_Element_File
methodpublicloadDefaultDecoratorsIsDisabled() : bool
Returns
TypeDescription
bool
methodpublicmarkAsError() : \Zend_Form_Element
inherited

Mark the element as being in a failed validation state

Inherited from: \Zend_Form_Element::markAsError()\Zend_Form_Element_Xhtml::markAsError()
Returns
TypeDescription
\Zend_Form_Element
methodpublicreceive() : boolean

Receive the uploaded file

Returns
TypeDescription
boolean
methodpublicremoveDecorator(string $name) : \Zend_Form_Element
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Form_Element
methodpublicremoveFilter(string $name) : \Zend_Form_Element_File

Remove an individual filter; proxy to adapter

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicremoveValidator(string $name) : \Zend_Form_Element_File

Remove validator by name; proxy to adapter

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicrender(\Zend_View_Interface $view = null) : string

Render form element Checks for decorator interface to prevent errors

Parameters
NameTypeDescription
$view\Zend_View_Interface
Returns
TypeDescription
string
methodpublicresolveElementId(\Zend_Form_Decorator_Interface $decorator) : string
staticinherited

Used to resolve and return an element ID

Inherited from: \Zend_Form_Element::resolveElementId()\Zend_Form_Element_Xhtml::resolveElementId()

Passed to the HtmlTag decorator as a callback in order to provide an ID.

Parameters
NameTypeDescription
$decorator\Zend_Form_Decorator_Interface
Returns
TypeDescription
string
methodpublicsetAllowEmpty(bool $flag) : \Zend_Form_Element

When the allow empty flag is enabled and the required flag is false, the element will validate with empty values.

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetAttrib(string $name, mixed $value) : \Zend_Form_Element
inherited

Set element attribute

Inherited from: \Zend_Form_Element::setAttrib()\Zend_Form_Element_Xhtml::setAttrib()
Parameters
NameTypeDescription
$namestring
$valuemixed
Returns
TypeDescription
\Zend_Form_Element
Throws
ExceptionDescription
\Zend_Form_Exceptionfor invalid $name values
methodpublicsetAttribs(array $attribs) : \Zend_Form_Element
inherited

Set multiple attributes at once

Inherited from: \Zend_Form_Element::setAttribs()\Zend_Form_Element_Xhtml::setAttribs()
Parameters
NameTypeDescription
$attribsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetAutoInsertNotEmptyValidator(bool $flag) : \Zend_Form_Element
inherited

Set flag indicating whether a NotEmpty validator should be inserted when element is required

Inherited from: \Zend_Form_Element::setAutoInsertNotEmptyValidator()\Zend_Form_Element_Xhtml::setAutoInsertNotEmptyValidator()
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetBelongsTo(string $array) : \Zend_Form_Element
inherited

Set array to which element belongs

Inherited from: \Zend_Form_Element::setBelongsTo()\Zend_Form_Element_Xhtml::setBelongsTo()
Parameters
NameTypeDescription
$arraystring
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetConfig(\Zend_Config $config) : \Zend_Form_Element
inherited

Set object state from Zend_Config object

Inherited from: \Zend_Form_Element::setConfig()\Zend_Form_Element_Xhtml::setConfig()
Parameters
NameTypeDescription
$config\Zend_Config
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetDecorators(array $decorators) : \Zend_Form_Element
Parameters
NameTypeDescription
$decoratorsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetDescription(string $description) : \Zend_Form_Element
Parameters
NameTypeDescription
$descriptionstring
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetDestination(string $path) : \Zend_Form_Element_File

Set the upload destination

Parameters
NameTypeDescription
$pathstring
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetDisableLoadDefaultDecorators(bool $flag) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetDisableTranslator(bool $flag) : \Zend_Form_Element_File

Indicate whether or not translation should be disabled

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetErrorMessageSeparator(string $separator) : \Zend_Form_Element
Parameters
NameTypeDescription
$separatorstring
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetErrorMessages(array $messages) : \Zend_Form_Element
inherited

Same as addErrorMessages(), but clears custom error message stack first

Inherited from: \Zend_Form_Element::setErrorMessages()\Zend_Form_Element_Xhtml::setErrorMessages()
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetErrors(array $messages) : \Zend_Form_Element
inherited

Overwrite any previously set error messages and flag as failed validation

Inherited from: \Zend_Form_Element::setErrors()\Zend_Form_Element_Xhtml::setErrors()
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetFilters( $filters) : \Zend_Form_Element_File

Sets a filter for the class, erasing all previous set; proxy to adapter

Parameters
NameTypeDescription
$filters
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetIgnore(bool $flag) : \Zend_Form_Element
inherited

Set ignore flag (used when retrieving values at form level)

Inherited from: \Zend_Form_Element::setIgnore()\Zend_Form_Element_Xhtml::setIgnore()
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetIsArray(bool $flag) : \Zend_Form_Element
inherited

Set flag indicating if element represents an array

Inherited from: \Zend_Form_Element::setIsArray()\Zend_Form_Element_Xhtml::setIsArray()
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetLabel(string $label) : \Zend_Form_Element
Parameters
NameTypeDescription
$labelstring
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetMaxFileSize(integer $size) : integer

Sets the maximum file size of the form

Parameters
NameTypeDescription
$sizeinteger
Returns
TypeDescription
integer
methodpublicsetMultiFile(integer $count) : \Zend_Form_Element_File

Set a multifile element

Parameters
NameTypeDescription
$countinteger

Number of file elements

Returns
TypeDescription
\Zend_Form_Element_FileProvides fluent interface
methodpublicsetName(string $name) : \Zend_Form_Element
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetOptions(array $options) : \Zend_Form_Element
inherited

Set object state from options array

Inherited from: \Zend_Form_Element::setOptions()\Zend_Form_Element_Xhtml::setOptions()
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetOrder(int $order) : \Zend_Form_Element
Parameters
NameTypeDescription
$orderint
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Form_Element_File

Set plugin loader

Parameters
NameTypeDescription
$loader\Zend_Loader_PluginLoader_Interface
$typestring
Returns
TypeDescription
\Zend_Form_Element_File
Throws
ExceptionDescription
\Zend_Form_Exceptionon invalid type
methodpublicsetRequired(bool $flag = true) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool

Default value is true

Returns
TypeDescription
\Zend_Form_Element
methodpublicsetTransferAdapter(string | \Zend_File_Transfer_Adapter_Abstract $adapter) : \Zend_Form_Element_File

Set transfer adapter

Parameters
NameTypeDescription
$adapterstring | \Zend_File_Transfer_Adapter_Abstract
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetTranslator(\Zend_Translate | null $translator = null) : \Zend_Form_Element_File

Set translator object for localization

Parameters
NameTypeDescription
$translator\Zend_Translate | null
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetValidators(array $validators) : \Zend_Form_Element_File

Add multiple validators at once, overwriting; proxy to adapter

Parameters
NameTypeDescription
$validatorsarray
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetValue(mixed $value) : \Zend_Form_Element_File

Disallow setting the value

Parameters
NameTypeDescription
$valuemixed
Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetValueDisabled(boolean $flag) : \Zend_Form_Element_File

Set if the file will be uploaded when getting the value This defaults to false which will force receive() when calling getValues()

Parameters
NameTypeDescription
$flagboolean

Sets if the file is handled as the elements value

Returns
TypeDescription
\Zend_Form_Element_File
methodpublicsetView(\Zend_View_Interface $view = null) : \Zend_Form_Element
Parameters
NameTypeDescription
$view\Zend_View_Interface
Returns
TypeDescription
\Zend_Form_Element
methodpublictranslatorIsDisabled() : bool

Is translation disabled?

Returns
TypeDescription
bool
Documentation was generated by phpDocumentor 2.0.0a12.