SanitizerUtil Class Reference

Inheritance diagram for SanitizerUtil:
BooleanSanitizerUtil ContactStateSanitizerUtil DateSanitizerUtil DateTimeSanitizerUtil DedupeSanitizerUtil DropDownSanitizerUtil EmailSanitizerUtil ExternalSystemIdSuppportedSanitizerUtil FullNameSanitizerUtil LowercaseSanitizerUtil MinimumLengthSanitizerUtil NumberSanitizerUtil PriceFrequencySanitizerUtil ProductTemplateStatusSanitizerUtil ProductTemplateTypeSanitizerUtil ProjectStatusSanitizerUtil RequiredSanitizerUtil SellPriceFormulaTypeSanitizerUtil TaskStatusSanitizerUtil TruncateSanitizerUtil UrlSanitizerUtil UserCurrencySanitizerUtil UserLanguageSanitizerUtil UserLocaleSanitizerUtil UserStatusSanitizerUtil UserTimeZoneSanitizerUtil

Public Member Functions

 sanitizeValue ($value)
 analyzeByRow (RedBean_OODBBean $rowBean)
 __construct ($modelClassName, $attributeName, $columnName, array $columnMappingData, ImportSanitizeResultsUtil $importSanitizeResultsUtil=null, $penultimateModelClassName, $penultimateAttributeName)
 shouldSanitizeValue ()
 getAnalysisMessages ()
 getShouldSkipRow ()

Static Public Member Functions

static getType ()
static getLinkedMappingRuleType ()
static shouldNotSaveModelOnSanitizingValueFailure ()

Protected Member Functions

 init ()
 assertMappingRuleDataIsValid ()

Static Protected Member Functions

static resolveMappingRuleData ($columnMappingData)

Protected Attributes

 $modelClassName
 $attributeName
 $analysisMessages = array()
 $shouldSkipRow = false
 $columnName
 $columnMappingData = array()
 $mappingRuleData = array()
 $importSanitizeResultsUtil
 $penultimateModelClassName
 $penultimateAttributeName

Detailed Description

Base sanitization utility to be overriden as needed for specific sanitizers. Sanitizer utils provide information on the data analyzers to utilize and if sql and batch analysis are supported. Also provides method to perform actual sanitization prior to setting the value in a model to import.

Sanitizers can inspect a value and based on rules, decide whether that value is valid or invalid. This information is then utilized to help users during the import process ensure their import data is correct before finalizing the import.

Definition at line 46 of file SanitizerUtil.php.


Constructor & Destructor Documentation

__construct ( modelClassName,
attributeName,
columnName,
array $  columnMappingData,
ImportSanitizeResultsUtil importSanitizeResultsUtil = null,
penultimateModelClassName,
penultimateAttributeName 
)
Parameters:
$modelClassName 
$attributeName 
$columnName 
array $columnMappingData
ImportSanitizeResultsUtil $importSanitizeResultsUtil

Definition at line 147 of file SanitizerUtil.php.


Member Function Documentation

sanitizeValue ( value  )  [abstract]
static getType (  )  [static]
Returns:
string - type of sanitizer

Definition at line 86 of file SanitizerUtil.php.

static shouldNotSaveModelOnSanitizingValueFailure (  )  [static]

If the sanitization of a value fails, should the entire row that is trying to be imported be ignored? Override if you want to change this value. Returning false means save the import row anyways regardless of if a sanitization of a value failed. If the model has other validation errors, these will block saving the model regardless of what value is returned here.

Returns:
boolean

Reimplemented in ContactStateSanitizerUtil, EmailSanitizerUtil, FullNameSanitizerUtil, IdValueTypeSanitizerUtil, MinimumLengthSanitizerUtil, NumberSanitizerUtil, RelatedModelNameOrIdValueTypeSanitizerUtil, RequiredSanitizerUtil, ProductTemplateStatusSanitizerUtil, ProjectStatusSanitizerUtil, and TaskStatusSanitizerUtil.

Definition at line 111 of file SanitizerUtil.php.

init (  )  [protected]

Override as needed

Reimplemented in IdValueTypeSanitizerUtil, RelatedModelNameOrIdValueTypeSanitizerUtil, and RoleValueTypeSanitizerUtil.

Definition at line 188 of file SanitizerUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sat Oct 21 07:10:30 2017