Form/Element/File.php

Show: inherited
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 [email protected] 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

Constant  TRANSFER_ADAPTER = 'TRANSFER_ADAPTER'

Plugin loader type

Constant  DECORATOR = 'DECORATOR'
inherited

Element Constants

Inherited from: \Zend_Form_Element::DECORATOR\Zend_Form_Element_Xhtml::DECORATOR
Constant  FILTER = 'FILTER'
Inherited_from
\Zend_Form_Element::FILTER  
Inherited_from
\Zend_Form_Element_Xhtml::FILTER  
Constant  VALIDATE = 'VALIDATE'

Properties

Propertyprotected\Zend_File_Transfer_Adapter_Abstract $_adapter =

Propertyprotectedbool $_allowEmpty = true
Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_allowEmpty  
Inherited_from
\Zend_Form_Element_Xhtml::$$_allowEmpty  
Propertyprotectedbool $_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
Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_autoInsertNotEmptyValidator  
Inherited_from
\Zend_Form_Element_Xhtml::$$_autoInsertNotEmptyValidator  
Propertyprotectedstring $_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  
Propertyprotectedinteger $_counter = 1

<p>Internal multifile counter</p>
Default value1Details
Type
integer
Propertyprotectedarray $_decorators = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_decorators  
Inherited_from
\Zend_Form_Element_Xhtml::$$_decorators  
Propertyprotectedstring $_description =
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_description  
Inherited_from
\Zend_Form_Element_Xhtml::$$_description  
Propertyprotectedbool $_disableLoadDefaultDecorators = false
inherited

Should we disable loading the default decorators?

Inherited from: \Zend_Form_Element::$$_disableLoadDefaultDecorators\Zend_Form_Element_Xhtml::$$_disableLoadDefaultDecorators
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_disableLoadDefaultDecorators  
Inherited_from
\Zend_Form_Element_Xhtml::$$_disableLoadDefaultDecorators  
Propertyprotectedstring $_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  
Propertyprotectedarray $_errorMessages = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_errorMessages  
Inherited_from
\Zend_Form_Element_Xhtml::$$_errorMessages  
Propertyprotectedarray $_errors = array()
inherited

Validation errors

Inherited from: \Zend_Form_Element::$$_errors\Zend_Form_Element_Xhtml::$$_errors
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_errors  
Inherited_from
\Zend_Form_Element_Xhtml::$$_errors  
Propertyprotectedarray $_filters = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Form_Element::$$_filters  
Inherited_from
\Zend_Form_Element_Xhtml::$$_filters  
Propertyprotectedbool $_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  
Propertyprotectedbool $_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  
Propertyprotectedbool $_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  
Propertyprotectedbool $_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  
Propertyprotectedbool $_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  
Propertyprotectedstring $_label =
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_label  
Inherited_from
\Zend_Form_Element_Xhtml::$$_label  
Propertyprotectedarray $_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  
Propertyprotectedinteger $_maxFileSize = -1
static

<p>Maximum file size for MAX_FILE_SIZE attribut of form</p>
Default value-1Details
Type
integer
Propertyprotectedarray $_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  
Propertyprotectedstring $_name =
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_name  
Inherited_from
\Zend_Form_Element_Xhtml::$$_name  
Propertyprotectedint $_order =
inherited

Order of element

Inherited from: \Zend_Form_Element::$$_order\Zend_Form_Element_Xhtml::$$_order
Details
Type
int
Inherited_from
\Zend_Form_Element::$$_order  
Inherited_from
\Zend_Form_Element_Xhtml::$$_order  
Propertyprotectedbool $_required = false
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_required  
Inherited_from
\Zend_Form_Element_Xhtml::$$_required  
Propertyprotected\Zend_Translate $_translator =
Propertyprotectedbool $_translatorDisabled = false
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Form_Element::$$_translatorDisabled  
Inherited_from
\Zend_Form_Element_Xhtml::$$_translatorDisabled  
Propertyprotectedstring $_type =
Details
Type
string
Inherited_from
\Zend_Form_Element::$$_type  
Inherited_from
\Zend_Form_Element_Xhtml::$$_type  
Propertyprotectedboolean $_validated = false

<p>Already validated ?</p>
Default valuefalseDetails
Type
boolean
Propertyprotectedarray $_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  
Propertyprotectedarray $_validators = array()
inherited

Array of initialized validators

<p>Validators</p>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  
Propertyprotectedmixed $_value =
Details
Type
mixed
Inherited_from
\Zend_Form_Element::$$_value  
Inherited_from
\Zend_Form_Element_Xhtml::$$_value  
Propertyprotectedboolean $_valueDisabled = false

<p>Disable value to be equal to file content</p>
Default valuefalseDetails
Type
boolean
Propertyprotected\Zend_View_Interface $_view =
Propertypublicstring $helper = 'formFile'
<p>Default view helper</p>

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
Name Type Description
$method string
$args array
Returns
Type Description
string
Throws
Exception Description
\Zend_Form_Exception for 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
Name Type Description
$spec string | array | \Zend_Config
$options array | \Zend_Config
Throws
Exception Description
\Zend_Form_Exception if 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
Name Type Description
$key string
Returns
Type Description
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
Name Type Description
$key string
$value mixed
Returns
Type Description
\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
Type Description
string
methodprivate_convertIniToInteger(string $setting) : integer

Converts a ini setting to a integer value

Parameters
Name Type Description
$setting string
Returns
Type Description
integer
methodprotected_filterValue(string $value, string $key) : void
Parameters
Name Type Description
$value string
$key string
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
Name Type Description
$name string
$options null | array
Returns
Type Description
\Zend_Form_Decorator_Interface
methodprotected_getErrorMessages() : array

Retrieve error messages and perform translation and value substitution

Returns
Type Description
array
methodprotected_hasErrorMessages() : bool
inherited

Are there custom error messages registered?

Inherited from: \Zend_Form_Element::_hasErrorMessages()\Zend_Form_Element_Xhtml::_hasErrorMessages()
Returns
Type Description
bool
methodprotected_loadDecorator(array $decorator, mixed $name) : \Zend_Form_Decorator_Interface
Parameters
Name Type Description
$decorator array

Decorator type and options

$name mixed

Decorator name or alias

Returns
Type Description
\Zend_Form_Decorator_Interface
methodprotected_loadFilter(array $filter) : \Zend_Filter_Interface
Parameters
Name Type Description
$filter array
Returns
Type Description
\Zend_Filter_Interface
methodprotected_loadValidator(array $validator) : \Zend_Validate_Interface
Parameters
Name Type Description
$validator array

Validator definition

Returns
Type Description
\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
Name Type Description
$decorator string | \Zend_Form_Decorator_Interface
$options array | \Zend_Config

Options with which to initialize decorator

Returns
Type Description
\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
Name Type Description
$decorators array
Returns
Type Description
\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
Name Type Description
$message string
Returns
Type Description
\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
Name Type Description
$message string
Returns
Type Description
\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
Name Type Description
$messages array
Returns
Type Description
\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
Name Type Description
$messages array
Returns
Type Description
\Zend_Form_Element
methodpublicaddFilter(string | array $filter, string | array $options = null) : \Zend_Form_Element_File

Add Filter; proxy to adapter

Parameters
Name Type Description
$filter string | array

Type of filter to add

$options string | array

Options to set for the filter

Returns
Type Description
\Zend_Form_Element_File
methodpublicaddFilters(array $filters) : \Zend_Form_Element_File

Add Multiple filters at once; proxy to adapter

Parameters
Name Type Description
$filters array
Returns
Type Description
\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
Name Type Description
$prefix string
$path string
$type string
Returns
Type Description
\Zend_Form_Element_File
Throws
Exception Description
\Zend_Form_Exception for 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
Name Type Description
$spec array
Returns
Type Description
\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
Name Type Description
$validator string | \Zend_Validate_Interface
$breakChainOnFailure bool
$options mixed
Returns
Type Description
\Zend_Form_Element_File
Throws
Exception Description
\Zend_Form_Exception if invalid validator type
methodpublicaddValidators(array $validators) : \Zend_Form_Element_File

Add multiple validators at once; proxy to adapter

Parameters
Name Type Description
$validators array
Returns
Type Description
\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
Type Description
bool
methodpublicclearDecorators() : \Zend_Form_Element
Returns
Type Description
\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
Type Description
\Zend_Form_Element
methodpublicclearFilters() : \Zend_Form_Element_File

Remove all filters; proxy to adapter

Returns
Type Description
\Zend_Form_Element_File
methodpublicclearValidators() : \Zend_Form_Element_File

Remove all validators; proxy to adapter

Returns
Type Description
\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
Name Type Description
$value string
$allowBrackets bool
Returns
Type Description
string
methodpublicgetAllowEmpty() : bool
Returns
Type Description
bool
methodpublicgetAttrib(string $name) : string
inherited

Retrieve element attribute

Inherited from: \Zend_Form_Element::getAttrib()\Zend_Form_Element_Xhtml::getAttrib()
Parameters
Name Type Description
$name string
Returns
Type Description
string
methodpublicgetAttribs() : array
inherited

Return all attributes

Inherited from: \Zend_Form_Element::getAttribs()\Zend_Form_Element_Xhtml::getAttribs()
Returns
Type Description
array
methodpublicgetBelongsTo() : string
inherited

Return array name to which element belongs

Inherited from: \Zend_Form_Element::getBelongsTo()\Zend_Form_Element_Xhtml::getBelongsTo()
Returns
Type Description
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
Name Type Description
$name string
Returns
Type Description
false | \Zend_Form_Decorator_Abstract
methodpublicgetDecorators() : array
inherited

Retrieve all decorators

Inherited from: \Zend_Form_Element::getDecorators()\Zend_Form_Element_Xhtml::getDecorators()
Returns
Type Description
array
methodpublicgetDescription() : string
inherited

Retrieve element description

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

Get the upload destination

Returns
Type Description
string
methodpublicgetErrorMessageSeparator() : string
Returns
Type Description
string
methodpublicgetErrorMessages() : array
inherited

Retrieve custom error messages

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

Retrieve error codes; proxy to transfer adapter

Returns
Type Description
array
methodpublicgetFileInfo(string $value = null) : array

Get internal file informations

Parameters
Name Type Description
$value string

(Optional) Element or file to return

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

Get the final filename

Parameters
Name Type Description
$value string

(Optional) Element or file to return

$path boolean

(Optional) Return also the path, defaults to true

Returns
Type Description
string
methodpublicgetFileSize() : string | array

Returns the filesize for this file element

Returns
Type Description
string | array Filesize
methodpublicgetFilter(string $name) : \Zend_Filter_Interface | null

Retrieve individual filter; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Filter_Interface | null
methodpublicgetFilters() : array

Returns all set filters; proxy to adapter

Returns
Type Description
array List of set filters
methodpublicgetFullyQualifiedName() : string

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

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

Returns the hash for this file element

Parameters
Name Type Description
$hash string

(Optional) Hash algorithm to use

Returns
Type Description
string | array Hashstring
methodpublicgetId() : string
inherited

Get element id

Inherited from: \Zend_Form_Element::getId()\Zend_Form_Element_Xhtml::getId()
Returns
Type Description
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
Type Description
bool
methodpublicgetLabel() : string
inherited

Retrieve element label

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

Sets the maximum file size of the form

Returns
Type Description
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
Type Description
array
methodpublicgetMimeType() : string | array

Returns the mimetype for this file element

Returns
Type Description
string | array Mimetype
methodpublicgetMultiFile() : integer

Returns the multifile element number

Returns
Type Description
integer
methodpublicgetName() : string
inherited

Return element name

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

Retrieve element order

Inherited from: \Zend_Form_Element::getOrder()\Zend_Form_Element_Xhtml::getOrder()
Returns
Type Description
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
Name Type Description
$type string
Returns
Type Description
\Zend_Loader_PluginLoader_Interface
Throws
Exception Description
\Zend_Loader_Exception on invalid type.
methodpublicgetTransferAdapter() : \Zend_File_Transfer_Adapter_Abstract

Get transfer adapter

Lazy loads HTTP transfer adapter when no adapter registered.

Returns
Type Description
\Zend_File_Transfer_Adapter_Abstract
methodpublicgetTranslator() : \Zend_Translate_Adapter | null

Retrieve localization translator object

Returns
Type Description
\Zend_Translate_Adapter | null
methodpublicgetType() : string
inherited

Return element type

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

Retrieve unfiltered element value

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

Retrieve validator by name; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Validate_Interface | null
methodpublicgetValidators() : array

Retrieve all validators; proxy to adapter

Returns
Type Description
array
methodpublicgetValue() : null | string

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

Returns
Type Description
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
Type Description
null | \Zend_View_Interface
methodpublichasErrors() : bool

Are there errors registered?

Returns
Type Description
bool
methodpublichasTranslator() : bool
inherited

Does this element have its own specific translator?

Inherited from: \Zend_Form_Element::hasTranslator()\Zend_Form_Element_Xhtml::hasTranslator()
Returns
Type Description
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
Type Description
bool
methodpublicisFiltered() : bool

Has the file been filtered?

Returns
Type Description
bool
methodpublicisReceived() : bool

Was the file received?

Returns
Type Description
bool
methodpublicisRequired() : bool
inherited

Is the element required?

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

Was the file uploaded?

Returns
Type Description
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
Name Type Description
$value string

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

$context mixed
Returns
Type Description
bool
Throws
Exception Description
\Zend_Validate_Exception If validation of $value is impossible
methodpublicisValueDisabled() : boolean

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

Returns
Type Description
boolean Receive the file on calling getValues()?
methodpublicloadDefaultDecorators() : \Zend_Form_Element_File

Load default decorators

Returns
Type Description
\Zend_Form_Element_File
methodpublicloadDefaultDecoratorsIsDisabled() : bool
Returns
Type Description
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
Type Description
\Zend_Form_Element
methodpublicreceive() : boolean

Receive the uploaded file

Returns
Type Description
boolean
methodpublicremoveDecorator(string $name) : \Zend_Form_Element
Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element
methodpublicremoveFilter(string $name) : \Zend_Form_Element_File

Remove an individual filter; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element_File
methodpublicremoveValidator(string $name) : \Zend_Form_Element_File

Remove validator by name; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element_File
methodpublicrender(\Zend_View_Interface $view = null) : string

Render form element Checks for decorator interface to prevent errors

Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
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
Name Type Description
$decorator \Zend_Form_Decorator_Interface
Returns
Type Description
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
Name Type Description
$flag bool
Returns
Type Description
\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
Name Type Description
$name string
$value mixed
Returns
Type Description
\Zend_Form_Element
Throws
Exception Description
\Zend_Form_Exception for 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
Name Type Description
$attribs array
Returns
Type Description
\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
Name Type Description
$flag bool
Returns
Type Description
\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
Name Type Description
$array string
Returns
Type Description
\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
Name Type Description
$config \Zend_Config
Returns
Type Description
\Zend_Form_Element
methodpublicsetDecorators(array $decorators) : \Zend_Form_Element
inherited

Overwrite all decorators

Inherited from: \Zend_Form_Element::setDecorators()\Zend_Form_Element_Xhtml::setDecorators()
Parameters
Name Type Description
$decorators array
Returns
Type Description
\Zend_Form_Element
methodpublicsetDescription(string $description) : \Zend_Form_Element
Parameters
Name Type Description
$description string
Returns
Type Description
\Zend_Form_Element
methodpublicsetDestination(string $path) : \Zend_Form_Element_File

Set the upload destination

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetDisableLoadDefaultDecorators(bool $flag) : \Zend_Form_Element
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetDisableTranslator(bool $flag) : \Zend_Form_Element_File

Indicate whether or not translation should be disabled

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetErrorMessageSeparator(string $separator) : \Zend_Form_Element
Parameters
Name Type Description
$separator string
Returns
Type Description
\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
Name Type Description
$messages array
Returns
Type Description
\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
Name Type Description
$messages array
Returns
Type Description
\Zend_Form_Element
methodpublicsetFilters( $filters) : \Zend_Form_Element_File

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

Parameters
Name Type Description
$filters
Returns
Type Description
\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
Name Type Description
$flag bool
Returns
Type Description
\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
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetLabel(string $label) : \Zend_Form_Element
inherited

Set element label

Inherited from: \Zend_Form_Element::setLabel()\Zend_Form_Element_Xhtml::setLabel()
Parameters
Name Type Description
$label string
Returns
Type Description
\Zend_Form_Element
methodpublicsetMaxFileSize(integer $size) : integer

Sets the maximum file size of the form

Parameters
Name Type Description
$size integer
Returns
Type Description
integer
methodpublicsetMultiFile(integer $count) : \Zend_Form_Element_File

Set a multifile element

Parameters
Name Type Description
$count integer

Number of file elements

Returns
Type Description
\Zend_Form_Element_File Provides fluent interface
methodpublicsetName(string $name) : \Zend_Form_Element
inherited

Set element name

Inherited from: \Zend_Form_Element::setName()\Zend_Form_Element_Xhtml::setName()
Parameters
Name Type Description
$name string
Returns
Type Description
\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
Name Type Description
$options array
Returns
Type Description
\Zend_Form_Element
methodpublicsetOrder(int $order) : \Zend_Form_Element
inherited

Set element order

Inherited from: \Zend_Form_Element::setOrder()\Zend_Form_Element_Xhtml::setOrder()
Parameters
Name Type Description
$order int
Returns
Type Description
\Zend_Form_Element
methodpublicsetPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Form_Element_File

Set plugin loader

Parameters
Name Type Description
$loader \Zend_Loader_PluginLoader_Interface
$type string
Returns
Type Description
\Zend_Form_Element_File
Throws
Exception Description
\Zend_Form_Exception on invalid type
methodpublicsetRequired(bool $flag = true) : \Zend_Form_Element
Parameters
Name Type Description
$flag bool

Default value is true

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

Set transfer adapter

Parameters
Name Type Description
$adapter string | \Zend_File_Transfer_Adapter_Abstract
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetTranslator(\Zend_Translate | null $translator = null) : \Zend_Form_Element_File

Set translator object for localization

Parameters
Name Type Description
$translator \Zend_Translate | null
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetValidators(array $validators) : \Zend_Form_Element_File

Add multiple validators at once, overwriting; proxy to adapter

Parameters
Name Type Description
$validators array
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetValue(mixed $value) : \Zend_Form_Element_File

Disallow setting the value

Parameters
Name Type Description
$value mixed
Returns
Type Description
\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
Name Type Description
$flag boolean

Sets if the file is handled as the elements value

Returns
Type Description
\Zend_Form_Element_File
methodpublicsetView(\Zend_View_Interface $view = null) : \Zend_Form_Element
inherited

Set view object

Inherited from: \Zend_Form_Element::setView()\Zend_Form_Element_Xhtml::setView()
Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
\Zend_Form_Element
methodpublictranslatorIsDisabled() : bool

Is translation disabled?

Returns
Type Description
bool
Documentation was generated by phpDocumentor 2.0.0a8.