Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 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

 $modelClassName
 
 $attributeName
 
 $analysisMessages = array()
 
 $shouldSkipRow = false
 
 $columnName
 
 $columnMappingData = array()
 
 $mappingRuleData = array()
 
 $importSanitizeResultsUtil
 
 $penultimateModelClassName
 
 $penultimateAttributeName
 
 $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,
  $attributeName,
  $columnName,
array  $columnMappingData,
ImportSanitizeResultsUtil  $importSanitizeResultsUtil = null,
  $penultimateModelClassName,
  $penultimateAttributeName,
  $explicitReadWriteModelPermissions = null 
)
Parameters
$modelClassName
$attributeName
$columnName
array$columnMappingData
ImportSanitizeResultsUtil$importSanitizeResultsUtil

Definition at line 149 of file SanitizerUtil.php.

Member Function Documentation

sanitizeValue (   $value)
abstract

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.

Parameters
mixed$value
analyzeByRow ( RedBean_OODBBean  $rowBean)
abstract
Parameters
$rowBean
static getType ( )
static
Returns
string - type of sanitizer

Definition at line 88 of file SanitizerUtil.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.

Definition at line 101 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

Definition at line 113 of file SanitizerUtil.php.

init ( )
protected

Override as needed

Definition at line 192 of file SanitizerUtil.php.

assertMappingRuleDataIsValid ( )
protected

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 Oct 28 2020 07:10:59
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.