Dojo/Form/Element/FilteringSelect.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_Dojo  
Subpackage
Form_Element  

\Zend_Dojo_Form_Element_FilteringSelect

Package: Zend\Dojo\Form\Element
FilteringSelect dijit

Note: this would be easier with mixins or traits...

Parent(s)
\Zend_Dojo_Form_Element_ComboBox < \Zend_Dojo_Form_Element_DijitMulti < \Zend_Dojo_Form_Element_Dijit < \Zend_Form_Element
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\global\Zend_Dojo_Form_Element_ComboBox  
Version
$Id: FilteringSelect.php 24593 2012-01-05 20:35:02Z matthew $  

Constants

Properties

>VPropertyprotectedbool $_isPartialRendering = false

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_Dojo_Form_Element_Dijit::$$_isPartialRendering  
Inherited_from
\Zend_Dojo_Form_Element_DijitMulti::$$_isPartialRendering  
Inherited_from
\Zend_Dojo_Form_Element_ComboBox::$$_isPartialRendering  
>VPropertyprotectedbool $_registerInArrayValidator = true
Flag: autoregister inArray validator?
Default valuetrueDetails
Type
bool
>VPropertyprotectedstring $_separator = '<br />'
inherited
Separator to use between options; defaults to '
'.
Inherited from: \Zend_Dojo_Form_Element_DijitMulti::$$_separator\Zend_Dojo_Form_Element_ComboBox::$$_separator
Default value'<br />'Details
Type
string
Inherited_from
\Zend_Dojo_Form_Element_DijitMulti::$$_separator  
Inherited_from
\Zend_Dojo_Form_Element_ComboBox::$$_separator  
>VPropertyprotectedarray $_translated = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Dojo_Form_Element_DijitMulti::$$_translated  
Inherited_from
\Zend_Dojo_Form_Element_ComboBox::$$_translated  
>VPropertypublicstring $helper = 'FilteringSelect'
Use FilteringSelect dijit view helper
Default value'FilteringSelect'Details
Type
string
>VPropertypublicarray $options = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Dojo_Form_Element_DijitMulti::$$options  
Inherited_from
\Zend_Dojo_Form_Element_ComboBox::$$options  

Methods

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

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(mixed $spec, mixed $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
$specmixed
$optionsmixed
Throws
ExceptionDescription
\Zend_Form_Exceptionif no element name after initialization
methodpublic__get(string $key) : mixed

Prevents access to properties beginning with '_'.

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

Proxies to render().

Returns
TypeDescription
string
methodprotected_filterValue(string $value, string $key) : void
Parameters
NameTypeDescription
$valuestring
$keystring
methodprotected_getDecorator(string $name, null | array $options) : \Zend_Form_Decorator_Interface
Parameters
NameTypeDescription
$namestring
$optionsnull | array
Returns
TypeDescription
\Zend_Form_Decorator_Interface
methodprotected_getErrorMessages() : array
Returns
TypeDescription
array
methodprotected_getMultiOptions() : array
Returns
TypeDescription
array
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_loadValidator(array $validator) : \Zend_Validate_Interface
Parameters
NameTypeDescription
$validatorarray

Validator definition

Returns
TypeDescription
\Zend_Validate_Interface
methodprotected_translateOption(string $option, string $value) : bool
Parameters
NameTypeDescription
$optionstring
$valuestring
Returns
TypeDescription
bool
methodprotected_translateValue(array | string $value) : array | string
Parameters
NameTypeDescription
$valuearray | string
Returns
TypeDescription
array | string
methodpublicaddDecorator(string | \Zend_Form_Decorator_Interface $decorator, array | \Zend_Config $options = null) : \Zend_Form_Element
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
Parameters
NameTypeDescription
$decoratorsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddError(string $message) : \Zend_Form_Element
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddErrorMessage(string $message) : \Zend_Form_Element
Parameters
NameTypeDescription
$messagestring
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddErrorMessages(array $messages) : \Zend_Form_Element
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddErrors(array $messages) : \Zend_Form_Element
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddFilter(string | \Zend_Filter_Interface $filter,  $options = array()) : \Zend_Form_Element
Parameters
NameTypeDescription
$filterstring | \Zend_Filter_Interface
$options
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddFilters(array $filters) : \Zend_Form_Element
Parameters
NameTypeDescription
$filtersarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicaddMultiOption(string $option, string $value = '') : \Zend_Form_Element_Multi
Parameters
NameTypeDescription
$optionstring
$valuestring
Returns
TypeDescription
\Zend_Form_Element_Multi
methodpublicaddMultiOptions(array $options) : \Zend_Form_Element_Multi
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Form_Element_Multi
methodpublicaddPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_Element

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
Throws
ExceptionDescription
\Zend_Form_Exceptionfor invalid type
methodpublicaddValidator(string | \Zend_Validate_Interface $validator, bool $breakChainOnFailure = false, array $options = array()) : \Zend_Form_Element

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

Parameters
NameTypeDescription
$validatorstring | \Zend_Validate_Interface
$breakChainOnFailurebool
$optionsarray
Returns
TypeDescription
\Zend_Form_Element
Throws
ExceptionDescription
\Zend_Form_Exceptionif invalid validator type
methodpublicaddValidators(array $validators) : \Zend_Form_Element
Parameters
NameTypeDescription
$validatorsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicautoInsertNotEmptyValidator() : bool
Returns
TypeDescription
bool
methodpublicfilterName(string $value, bool $allowBrackets = false) : string
Parameters
NameTypeDescription
$valuestring
$allowBracketsbool
Returns
TypeDescription
string
methodpublicgetAttrib(string $name) : string
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
string
methodpublicgetAutocomplete() : bool
inherited

Get autocomplete flag

Inherited from: \Zend_Dojo_Form_Element_ComboBox::getAutocomplete()
Returns
TypeDescription
bool
methodpublicgetBelongsTo() : string
Returns
TypeDescription
string
methodpublicgetDecorator(string $name) : false | \Zend_Form_Decorator_Abstract
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
false | \Zend_Form_Decorator_Abstract
methodpublicgetDijitParam(string $key) : mixed
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
mixed
methodpublicgetDijitParams() : array
Returns
TypeDescription
array
methodpublicgetFilter(string $name) : \Zend_Filter_Interface
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Filter_Interface
methodpublicgetFullyQualifiedName() : string

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

Returns
TypeDescription
string
methodpublicgetIgnore() : bool
Returns
TypeDescription
bool
methodpublicgetMessages() : array

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
methodpublicgetMultiOption(string $option) : mixed
Parameters
NameTypeDescription
$optionstring
Returns
TypeDescription
mixed
methodpublicgetMultiOptions() : array
Returns
TypeDescription
array
methodpublicgetPluginLoader(string $type) : \Zend_Loader_PluginLoader

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
Throws
ExceptionDescription
\Zend_Loader_Exceptionon invalid type.
methodpublicgetSeparator() : mixed
Returns
TypeDescription
mixed
methodpublicgetStoreId() : string | null
inherited

Get datastore identifier

Inherited from: \Zend_Dojo_Form_Element_ComboBox::getStoreId()
Returns
TypeDescription
string | null
methodpublicgetStoreInfo() : array
inherited

Get datastore information

Inherited from: \Zend_Dojo_Form_Element_ComboBox::getStoreInfo()
Returns
TypeDescription
array
methodpublicgetStoreParams() : array
inherited

Get datastore params

Inherited from: \Zend_Dojo_Form_Element_ComboBox::getStoreParams()
Returns
TypeDescription
array
methodpublicgetStoreType() : string | null
inherited

Get datastore dijit type

Inherited from: \Zend_Dojo_Form_Element_ComboBox::getStoreType()
Returns
TypeDescription
string | null
methodpublicgetValidator(string $name) : \Zend_Validate_Interface | false
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Validate_Interface | falseFalse if not found, validator otherwise
methodpublicgetView() : null | \Zend_View_Interface

Retrieves from ViewRenderer if none previously set.

Returns
TypeDescription
null | \Zend_View_Interface
methodpublichasDijitParam(string $key) : bool
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
bool
methodpublichasTranslator() : bool
Returns
TypeDescription
bool
methodpublicisValid(string $value, mixed $context = null) : bool
inherited

Is the value valid?

Inherited from: \Zend_Dojo_Form_Element_ComboBox::isValid()

Autoregisters InArray validator if necessary.

Parameters
NameTypeDescription
$valuestring
$contextmixed
Returns
TypeDescription
bool
Throws
ExceptionDescription
\Zend_Validate_ExceptionIf validation of $value is impossible
methodpublicregisterInArrayValidator() : bool
Returns
TypeDescription
bool
methodpublicremoveDijitParam(string $key) : \Zend_Dojo_Form_Element_Dijit
Parameters
NameTypeDescription
$keystring
Returns
TypeDescription
\Zend_Dojo_Form_Element_Dijit
methodpublicremoveMultiOption(string $option) : bool
Parameters
NameTypeDescription
$optionstring
Returns
TypeDescription
bool
methodpublicremoveValidator(string $name) : bool
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
bool
methodpublicrender(\Zend_View_Interface $view = null) : string
Parameters
NameTypeDescription
$view\Zend_View_Interface
Returns
TypeDescription
string
methodpublicresolveElementId(\Zend_Form_Decorator_Interface $decorator) : string

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
Parameters
NameTypeDescription
$namestring
$valuemixed
Returns
TypeDescription
\Zend_Form_Element
Throws
ExceptionDescription
\Zend_Form_Exceptionfor invalid $name values
methodpublicsetAttribs(array $attribs) : \Zend_Form_Element
Parameters
NameTypeDescription
$attribsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetAutoInsertNotEmptyValidator(bool $flag) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetAutocomplete(bool $flag) : \Zend_Dojo_Form_Element_ComboBox
inherited

Set autocomplete flag

Inherited from: \Zend_Dojo_Form_Element_ComboBox::setAutocomplete()
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Dojo_Form_Element_ComboBox
methodpublicsetBelongsTo(string $array) : \Zend_Form_Element
Parameters
NameTypeDescription
$arraystring
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
methodpublicsetDijitParam(string $key, mixed $value) : \Zend_Dojo_Form_Element_Dijit
Parameters
NameTypeDescription
$keystring
$valuemixed
Returns
TypeDescription
\Zend_Dojo_Form_Element_Dijit
methodpublicsetDijitParams(array $params) : \Zend_Dojo_Form_Element_Dijit
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
\Zend_Dojo_Form_Element_Dijit
methodpublicsetDisableTranslator(bool $flag) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetErrorMessages(array $messages) : \Zend_Form_Element
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetErrors(array $messages) : \Zend_Form_Element
Parameters
NameTypeDescription
$messagesarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetFilters(array $filters) : \Zend_Form_Element
Parameters
NameTypeDescription
$filtersarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetIgnore(bool $flag) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetIsArray(bool $flag) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetLabel(string $label) : \Zend_Form_Element
Parameters
NameTypeDescription
$labelstring
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetMultiOptions(array $options) : \Zend_Form_Element_Multi
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Form_Element_Multi
methodpublicsetOptions(array $options) : \Zend_Form_Element
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Form_Element
Parameters
NameTypeDescription
$loader\Zend_Loader_PluginLoader_Interface
$typestring

'decorator', 'filter', or 'validate'

Returns
TypeDescription
\Zend_Form_Element
Throws
ExceptionDescription
\Zend_Form_Exceptionon invalid type
methodpublicsetRegisterInArrayValidator(bool $flag) : \Zend_Form_Element_Multi
inherited

Set flag indicating whether or not to auto-register inArray validator

Inherited from: \Zend_Dojo_Form_Element_DijitMulti::setRegisterInArrayValidator()\Zend_Dojo_Form_Element_ComboBox::setRegisterInArrayValidator()
Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Form_Element_Multi
methodpublicsetRequired(bool $flag = true) : \Zend_Form_Element
Parameters
NameTypeDescription
$flagbool

Default value is true

Returns
TypeDescription
\Zend_Form_Element
methodpublicsetSeparator(mixed $separator) : \Zend_Dojo_Form_Element_FilteringSelect
Parameters
NameTypeDescription
$separatormixed
Returns
TypeDescription
\Zend_Dojo_Form_Element_FilteringSelect
Details
Fluent
This method is part of a fluent interface and will return the same instance  
methodpublicsetStoreId(string $identifier) : \Zend_Dojo_Form_Element_ComboBox
inherited

Set datastore identifier

Inherited from: \Zend_Dojo_Form_Element_ComboBox::setStoreId()
Parameters
NameTypeDescription
$identifierstring
Returns
TypeDescription
\Zend_Dojo_Form_Element_ComboBox
methodpublicsetStoreParams(array $params) : \Zend_Dojo_Form_Element_ComboBox
inherited

Set datastore parameters

Inherited from: \Zend_Dojo_Form_Element_ComboBox::setStoreParams()
Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
\Zend_Dojo_Form_Element_ComboBox
methodpublicsetStoreType(string $dojoType) : \Zend_Dojo_Form_Element_ComboBox
inherited

Set datastore dijit type

Inherited from: \Zend_Dojo_Form_Element_ComboBox::setStoreType()
Parameters
NameTypeDescription
$dojoTypestring
Returns
TypeDescription
\Zend_Dojo_Form_Element_ComboBox
methodpublicsetTranslator(\Zend_Translate | null $translator = null) : \Zend_Form_Element
Parameters
NameTypeDescription
$translator\Zend_Translate | null
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetValidators(array $validators) : \Zend_Form_Element
Parameters
NameTypeDescription
$validatorsarray
Returns
TypeDescription
\Zend_Form_Element
methodpublicsetView(\Zend_View_Interface $view = null) : \Zend_Dojo_Form_Element_Dijit

Ensures that the view object has the dojo view helper path set.

Parameters
NameTypeDescription
$view\Zend_View_Interface
Returns
TypeDescription
\Zend_Dojo_Form_Element_Dijit
Documentation was generated by phpDocumentor 2.0.0a12.