All Data Structures Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
RelatedModelNameOrIdValueTypeSanitizerUtil Class Reference
Inheritance diagram for RelatedModelNameOrIdValueTypeSanitizerUtil:
IdValueTypeSanitizerUtil ExternalSystemIdSuppportedSanitizerUtil SanitizerUtil RoleValueTypeSanitizerUtil

Public Member Functions

 __construct ($modelClassName, $attributeName, $columnName, array $columnMappingData, ImportSanitizeResultsUtil $importSanitizeResultsUtil=null, $penultimateModelClassName, $penultimateAttributeName, $explicitReadWriteModelPermissions=null)
 
 analyzeByRow (RedBean_OODBBean $rowBean)
 
 sanitizeValue ($value)
 
- Public Member Functions inherited from IdValueTypeSanitizerUtil
 analyzeByRow (RedBean_OODBBean $rowBean)
 
- Public Member Functions inherited from SanitizerUtil
 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 getLinkedMappingRuleType ()
 
static shouldNotSaveModelOnSanitizingValueFailure ()
 
- Static Public Member Functions inherited from IdValueTypeSanitizerUtil
static getLinkedMappingRuleType ()
 
static shouldNotSaveModelOnSanitizingValueFailure ()
 
- Static Public Member Functions inherited from ExternalSystemIdSuppportedSanitizerUtil
static getModelByExternalSystemIdAndModelClassName ($id, $modelClassName)
 
- Static Public Member Functions inherited from SanitizerUtil
static getType ()
 
static getLinkedMappingRuleType ()
 
static shouldNotSaveModelOnSanitizingValueFailure ()
 

Protected Member Functions

 resolveFoundNameByValue (RedBean_OODBBean $rowBean)
 
 ensureTypeValueIsValid ($type)
 
 assertMappingRuleDataIsValid ()
 
 init ()
 
 resolveForFoundModel ()
 
 resolveForUnfoundModel (RedBean_OODBBean $rowBean)
 
- Protected Member Functions inherited from IdValueTypeSanitizerUtil
 resolveFindingModelDuringAnalysis ($found, RedBean_OODBBean $rowBean)
 
 resolveExternalSystemIdValueIsTooLong (RedBean_OODBBean $rowBean)
 
 resolveForUnfoundModel (RedBean_OODBBean $rowBean)
 
 ensureTypeValueIsValid ($type)
 
 assertMappingRuleDataIsValid ()
 
 resolveMappingRuleDataType ()
 
 init ()
 
- Protected Member Functions inherited from ExternalSystemIdSuppportedSanitizerUtil
 resolveFoundIdByValue ($value)
 
 resolveAttributeModelClassName (RedBeanModel $model, $attributeName)
 
 resolveForFoundModel ()
 
 resolveFoundExternalSystemIdByValue ($value)
 
- Protected Member Functions inherited from SanitizerUtil
 init ()
 
 assertMappingRuleDataIsValid ()
 

Protected Attributes

 $maxNameLength
 
- Protected Attributes inherited from IdValueTypeSanitizerUtil
 $type
 
- Protected Attributes inherited from ExternalSystemIdSuppportedSanitizerUtil
 $externalSystemIdMaxLength = 40
 
 $attributeModelClassName
 
- Protected Attributes inherited from SanitizerUtil
 $modelClassName
 
 $attributeName
 
 $analysisMessages = array()
 
 $shouldSkipRow = false
 
 $columnName
 
 $columnMappingData = array()
 
 $mappingRuleData = array()
 
 $importSanitizeResultsUtil
 
 $penultimateModelClassName
 
 $penultimateAttributeName
 
 $explicitReadWriteModelPermissions = null
 

Additional Inherited Members

- Static Protected Member Functions inherited from SanitizerUtil
static resolveMappingRuleData ($columnMappingData)
 

Detailed Description

Sanitizer to handle attribute values that are possible a model name not just a model id.

Override to accomodate a value type of 'ZURMO_MODEL_NAME'. This would represent a model 'name' attribute value that can be used as a unique identifier to map to existing models. An example is when importing a contact, and the account name is provided. If the name is found, then the contact will be connected to the existing account otherwise a new account is created with the name provided.

Definition at line 46 of file RelatedModelNameOrIdValueTypeSanitizerUtil.php.

Member Function Documentation

static shouldNotSaveModelOnSanitizingValueFailure ( )
static

If a model id value is invalid, then continue importing the row

Definition at line 68 of file RelatedModelNameOrIdValueTypeSanitizerUtil.php.

analyzeByRow ( RedBean_OODBBean  $rowBean)
Parameters
RedBean_OODBBean$rowBean
Exceptions
NotSupportedException

Definition at line 77 of file RelatedModelNameOrIdValueTypeSanitizerUtil.php.

sanitizeValue (   $value)

Given a value that is either a zurmo id or an external system id, resolve that the value is valid. The value presented can also be a 'name' value. If the name is not found as a model in the system, then a new related model will be created using this name. NOTE - If the related model has other required attributes that have no default values, then there will be a problem saving this new model. This is too be resolved at some point. If the value is not valid then an InvalidValueToSanitizeException is thrown.

Parameters
mixed$value
Returns
sanitized value
Exceptions
InvalidValueToSanitizeException
NotFoundException
NotSupportedException

Definition at line 149 of file RelatedModelNameOrIdValueTypeSanitizerUtil.php.

ensureTypeValueIsValid (   $type)
protected

Ensure the type is an accepted type.

Parameters
unknown_typeinteger

Definition at line 248 of file RelatedModelNameOrIdValueTypeSanitizerUtil.php.


The documentation for this class was generated from the following file:
Generated on Sun May 31 2020 07:10:58