BooleanSanitizerUtil Class Reference

Inheritance diagram for BooleanSanitizerUtil:
SanitizerUtil

Public Member Functions

 analyzeByRow (RedBean_OODBBean $rowBean)
 sanitizeValue ($value)

Static Public Member Functions

static getAcceptableValuesResolvingValues ()
static getAcceptableValues ()
static getLinkedMappingRuleType ()

Protected Member Functions

 assertMappingRuleDataIsValid ()

Detailed Description

Sanitizer for boolean type attributes. There is a variety of values that are accepted and converted into the boolean values at import time.

Definition at line 41 of file BooleanSanitizerUtil.php.


Member Function Documentation

static getAcceptableValuesResolvingValues (  )  [static]

THE KEYS MUST MATCH THE KEYS IN getAcceptableValues() to have the correct mapping This method and getAcceptableValues() to be split because of some type casting issues in php where the keys were getting turned into integers instead of remaining as strings. Lowercase array of mappable boolean values. These values if found in an import, will be converted correctly to false/true. All other values are not valid.

See also:
getAcceptableValues()

Definition at line 51 of file BooleanSanitizerUtil.php.

static getAcceptableValues (  )  [static]

THE KEYS MUST MATCH THE KEYS IN getAcceptableValuesResolvingValues() to have the correct mapping This method and getAcceptableValuesResolvingValue() needed to be split because of some type casting issues in php where the keys were getting turned into integers instead of remaining as strings.

See also:
getAcceptableValuesResolvingValues()

Definition at line 72 of file BooleanSanitizerUtil.php.

static getLinkedMappingRuleType (  )  [static]
Returns:
string - the type of linked mapping rule or null if none available. Some sanitizers and data analyzers need information from a mapping rule form in order to perform their job. This method returns the type of mapping rule form.

Reimplemented from SanitizerUtil.

Definition at line 87 of file BooleanSanitizerUtil.php.

analyzeByRow ( RedBean_OODBBean $  rowBean  ) 
Parameters:
RedBean_OODBBean $rowBean

Reimplemented from SanitizerUtil.

Definition at line 95 of file BooleanSanitizerUtil.php.

sanitizeValue ( value  ) 

Given a value, attempt to convert the value to either true/false based on a mapping array of possible boolean values. If the value is not present, attemp to utilize the default value specified. If the value presented is not a valid mapping value then a InvalidValueToSanitizeException will be thrown.

Parameters:
mixed $value
Returns:
sanitized value
Exceptions:
InvalidValueToSanitizeException 

Reimplemented from SanitizerUtil.

Definition at line 115 of file BooleanSanitizerUtil.php.

assertMappingRuleDataIsValid (  )  [protected]

Override as needed

Reimplemented from SanitizerUtil.

Definition at line 142 of file BooleanSanitizerUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Jul 28 07:10:22 2014