package Default
inherited_from \Zend\Filter\AbstractFilter

 Methods

Constructor

__construct(array|\Traversable|integer|null $typeOrOptions = null, boolean $casting = true, array $translations = array()

Parameters

$typeOrOptions

array\Traversableintegernull

$casting

boolean

$translations

array

Invoke filter as a command

__invoke(mixed $value) : mixed
Inherited

Proxies to \filter()

Parameters

$value

mixed

Exceptions

\Zend\Filter\Exception\ExceptionInterface If filtering $value is impossible

Returns

mixed

Defined by Zend\Filter\FilterInterface

filter(string $value) : string

Returns a boolean representation of $value

Parameters

$value

string

Returns

string

Returns the casting option

getCasting() : boolean

Returns

boolean

Retrieve options representing object state

getOptions() : array
Inherited

Returns

array

getTranslations()

getTranslations() : array

Returns

array

Returns defined boolean types

getType() : integer

Returns

integer

hasPcreUnicodeSupport()

hasPcreUnicodeSupport() : boolean
InheritedStatic
deprecated Since 2.1.0

Returns

boolean

Set the working mode

setCasting(boolean $flag = true) : \Zend\Filter\Boolean
fluent This method is part of a fluent interface and will return the same instance

Parameters

$flag

boolean

When true this filter works like cast When false it recognises only true and false and all other values are returned as is

Returns

\Zend\Filter\Boolean

setOptions()

setOptions(array|\Traversable $options) : \Zend\Filter\Boolean
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Boolean

setTranslations()

setTranslations(array|\Traversable $translations) : \Zend\Filter\Boolean
fluent This method is part of a fluent interface and will return the same instance

Parameters

$translations

array\Traversable

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Boolean

Set boolean types

setType(integer|array $type = null) : \Zend\Filter\Boolean
fluent This method is part of a fluent interface and will return the same instance

Parameters

$type

integerarray

Exceptions

\Zend\Filter\Exception\InvalidArgumentException

Returns

\Zend\Filter\Boolean

isOptions()

isOptions(mixed $options) : boolean
InheritedStatic

Parameters

$options

mixed

Returns

boolean

 Properties

 

$constants

$constants : array

Default

array(self::TYPE_BOOLEAN => 'boolean', self::TYPE_INTEGER => 'integer', self::TYPE_FLOAT => 'float', self::TYPE_STRING => 'string', self::TYPE_ZERO_STRING => 'zero', self::TYPE_EMPTY_ARRAY => 'array', self::TYPE_NULL => 'null', self::TYPE_PHP => 'php', self::TYPE_FALSE_STRING => 'false', self::TYPE_LOCALIZED => 'localized', self::TYPE_ALL => 'all')
 

Filter options

$options : array

Default

array('type' => self::TYPE_PHP, 'casting' => true, 'translations' => array())
inherited_from \Zend\Filter\AbstractFilter::options
 

Filter options

$options : array

Default

array()

 Constants

 

TYPE_ALL

TYPE_ALL = 511 
 

TYPE_BOOLEAN

TYPE_BOOLEAN = 1 
 

TYPE_EMPTY_ARRAY

TYPE_EMPTY_ARRAY = 32 
 

TYPE_FALSE_STRING

TYPE_FALSE_STRING = 128 
 

TYPE_FLOAT

TYPE_FLOAT = 4 
 

TYPE_INTEGER

TYPE_INTEGER = 2 
 

TYPE_LOCALIZED

TYPE_LOCALIZED = 256 
 

TYPE_NULL

TYPE_NULL = 64 
 

TYPE_PHP

TYPE_PHP = 127 
 

TYPE_STRING

TYPE_STRING = 8 
 

TYPE_ZERO_STRING

TYPE_ZERO_STRING = 16