Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_Filter_Boolean Class Reference

Public Member Functions

 __construct ($options=null)
 Constructor.
 
 getType ()
 Returns the set null types.
 
 setType ($type=null)
 Set the null types.
 
 getLocale ()
 Returns the set locale.
 
 setLocale ($locale=null)
 Set the locales which are accepted.
 
 getCasting ()
 Returns the casting option.
 
 setCasting ($casting=true)
 Set the working mode.
 
 filter ($value)
 Defined by Zend_Filter_Interface.
 

Public Attributes

const BOOLEAN = 1
 
const INTEGER = 2
 
const FLOAT = 4
 
const STRING = 8
 
const ZERO = 16
 
const EMPTY_ARRAY = 32
 
const NULL = 64
 
const PHP = 127
 
const FALSE_STRING = 128
 
const YES = 256
 
const ALL = 511
 

Protected Member Functions

 _getLocalizedQuestion ($value, $yes, $locale)
 Determine the value of a localized string, and compare it to a given value.
 

Protected Attributes

 $_constants
 
 $_type = self::PHP
 
 $_locale = array('auto')
 
 $_casting = true
 

Constructor & Destructor Documentation

__construct (   $options = null)

Constructor.

Parameters
string | array | Zend_Config$optionsOPTIONAL

Member Function Documentation

_getLocalizedQuestion (   $value,
  $yes,
  $locale 
)
protected

Determine the value of a localized string, and compare it to a given value.

Parameters
string$value
boolean$yes
array$locale
Returns
boolean
filter (   $value)

Defined by Zend_Filter_Interface.

Returns a boolean representation of $value

Parameters
string$value
Returns
string

Implements Zend_Filter_Interface.

getCasting ( )

Returns the casting option.

Returns
boolean
getLocale ( )

Returns the set locale.

Returns
array
getType ( )

Returns the set null types.

Returns
int
setCasting (   $casting = true)

Set the working mode.

Parameters
boolean$localeWhen true this filter works like cast When false it recognises only true and false and all other values are returned as is
Exceptions
Zend_Filter_Exception
Returns
Zend_Filter_Boolean
setLocale (   $locale = null)

Set the locales which are accepted.

Parameters
string | array | Zend_Locale$locale
Exceptions
Zend_Filter_Exception
Returns
Zend_Filter_Boolean
setType (   $type = null)

Set the null types.

Parameters
integer | array$type
Exceptions
Zend_Filter_Exception
Returns
Zend_Filter_Boolean

Member Data Documentation

$_casting = true
protected
$_constants
protected
Initial value:
= array(
self::BOOLEAN => 'boolean',
self::INTEGER => 'integer',
self::FLOAT => 'float',
self::STRING => 'string',
self::ZERO => 'zero',
self::EMPTY_ARRAY => 'array',
self::NULL => 'null',
self::PHP => 'php',
self::FALSE_STRING => 'false',
self::YES => 'yes',
self::ALL => 'all',
)
$_locale = array('auto')
protected
$_type = self::PHP
protected
const ALL = 511
const BOOLEAN = 1
const EMPTY_ARRAY = 32
const FALSE_STRING = 128
const FLOAT = 4
const INTEGER = 2
const NULL = 64
const PHP = 127
const STRING = 8
const YES = 256
const ZERO = 16