All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
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, $explicitReadWriteModelPermissions=null)
 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

 $analysisMessages = array()
 $shouldSkipRow = false
 $columnMappingData = array()
 $mappingRuleData = array()
 $explicitReadWriteModelPermissions = null

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,
array  $columnMappingData,
ImportSanitizeResultsUtil  $importSanitizeResultsUtil = null,
  $explicitReadWriteModelPermissions = null 

Definition at line 149 of file SanitizerUtil.php.

Member Function Documentation

sanitizeValue (   $value)

Sanitize a value, returning a sanitized value either as the same cast or different cast. This is the final step for importing a row, this method is called as the value from the import column for a row is ready to be populated into a model to save. This method can also be called in a chain of sanitizers based on what sanitizers are set for a given attribute import rule. depending on the circumstances.

analyzeByRow ( RedBean_OODBBean  $rowBean)
static getType ( )
string - type of sanitizer

Definition at line 88 of file SanitizerUtil.php.

static getLinkedMappingRuleType ( )
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.

Definition at line 101 of file SanitizerUtil.php.

static shouldNotSaveModelOnSanitizingValueFailure ( )

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.


Definition at line 113 of file SanitizerUtil.php.

init ( )

Override as needed

Definition at line 192 of file SanitizerUtil.php.

assertMappingRuleDataIsValid ( )

Override as needed

Definition at line 199 of file SanitizerUtil.php.

The documentation for this class was generated from the following file:
Generated on Wed Apr 8 2020 07:11:18