ImportMappingUtil Class Reference

Static Public Member Functions

static makeMappingDataByTableName ($tableName)
static getMappedAttributeIndicesOrDerivedAttributeTypesByMappingData ($mappingData)
static makeExtraColumnNameByColumnCount ($columnCount)
static reIndexExtraColumnNamesByPostData ($postData)
static makeColumnNamesAndAttributeIndexOrDerivedTypeLabels ($mappingData, $importRulesType)
static makeBooleanColumnMappingData ($attributeName)
static makeCurrencyColumnMappingData ($attributeName, $currency, $defaultValue=null, $rateToBase=1)
static makeDateColumnMappingData ($attributeName, $defaultValue=null, $format= 'MM-dd-yyyy')
static makeDateTimeColumnMappingData ($attributeName, $defaultValue=null, $format= 'MM-dd-yyyy hh:mm')
static makeDropDownColumnMappingData ($attributeName, $defaultValue=null, $customFieldsInstructionData=null)
static makeMultiSelectDropDownColumnMappingData ($attributeName, $defaultValue=null, $customFieldsInstructionData=null)
static makeTagCloudColumnMappingData ($attributeName, $defaultValue=null, $customFieldsInstructionData=null)
static makeEmailColumnMappingData ($attributeName, $defaultValue=null)
static makeFloatColumnMappingData ($attributeName, $defaultValue=null)
static makeIntegerColumnMappingData ($attributeName, $defaultValue=null)
static makeHasOneColumnMappingData ($attributeName, $type=RelatedModelValueTypeMappingRuleForm::ZURMO_MODEL_ID)
static makeModelDerivedColumnMappingData ($derivedAttributeName, $type=IdValueTypeMappingRuleForm::EXTERNAL_SYSTEM_ID)
static makeStringColumnMappingData ($attributeName, $defaultValue=null)
static makeTextAreaColumnMappingData ($attributeName)
static makeUrlColumnMappingData ($attributeName, $defaultValue=null)

Detailed Description

Helper utility for working with import mapping.

Definition at line 40 of file ImportMappingUtil.php.


Member Function Documentation

static makeMappingDataByTableName ( tableName  )  [static]

Given an import data's table name, create a basic mapping data array that has the correct starting elements set as null. This will ensure the mapping data array is always structured correctly. Each key will be a column name from the table. Throws an exception if the table is missing rows.

Parameters:
string $tableName
Returns:
array $mappingData

Definition at line 49 of file ImportMappingUtil.php.

static getMappedAttributeIndicesOrDerivedAttributeTypesByMappingData ( mappingData  )  [static]

Given an array of mapping data, extract the 'attributeIndexOrDerivedType' from each sub array in the mapping data and return an array of the attributeIndexOrDerivedType. This is useful if you just need a single dimension array of this information based on the mapping data.

Parameters:
array $mappingData
Returns:
array

Definition at line 108 of file ImportMappingUtil.php.

static makeExtraColumnNameByColumnCount ( columnCount  )  [static]

Given a column count, create a suitable column name. An example would be column_5, where 5 would have been the column count that was passed in. This pattern column_x matches the pattern used by redbean to generate column names.

Parameters:
integer $columnCount

Definition at line 128 of file ImportMappingUtil.php.

static reIndexExtraColumnNamesByPostData ( postData  )  [static]

Given an array of post data, re-index the column names that are of type 'extraColumn'. This method is needed since it is possible that a user can add, remove extra columns in such a way that produces column names that are missing index orders. This will fix the extra column column names and return the data.

Parameters:
array $postData

Definition at line 140 of file ImportMappingUtil.php.

static makeColumnNamesAndAttributeIndexOrDerivedTypeLabels ( mappingData,
importRulesType 
) [static]

Make an array of index/values that are the column names and their respective labels.

Parameters:
array $mappingData
array $importRulesType

Definition at line 174 of file ImportMappingUtil.php.

static makeCurrencyColumnMappingData ( attributeName,
currency,
defaultValue = null,
rateToBase = 1 
) [static]
Parameters:
string $attributeName
Currency $currency
null $defaultValue
int $rateToBase
Returns:
array

Definition at line 209 of file ImportMappingUtil.php.

static makeDateColumnMappingData ( attributeName,
defaultValue = null,
format = 'MM-dd-yyyy' 
) [static]
Parameters:
string $attributeName
null $defaultValue
string $format
Returns:
array

Definition at line 228 of file ImportMappingUtil.php.

static makeDateTimeColumnMappingData ( attributeName,
defaultValue = null,
format = 'MM-dd-yyyy hh:mm' 
) [static]
Parameters:
string $attributeName
null $defaultValue
string $format
Returns:
array

Definition at line 244 of file ImportMappingUtil.php.

static makeDropDownColumnMappingData ( attributeName,
defaultValue = null,
customFieldsInstructionData = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
null $importInstructionsData
Returns:
array

Definition at line 260 of file ImportMappingUtil.php.

static makeMultiSelectDropDownColumnMappingData ( attributeName,
defaultValue = null,
customFieldsInstructionData = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
null $importInstructionsData
Returns:
array

Definition at line 280 of file ImportMappingUtil.php.

static makeTagCloudColumnMappingData ( attributeName,
defaultValue = null,
customFieldsInstructionData = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
null $importInstructionsData
Returns:
array

Definition at line 300 of file ImportMappingUtil.php.

static makeEmailColumnMappingData ( attributeName,
defaultValue = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
Returns:
array

Definition at line 319 of file ImportMappingUtil.php.

static makeFloatColumnMappingData ( attributeName,
defaultValue = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
Returns:
array

Definition at line 333 of file ImportMappingUtil.php.

static makeHasOneColumnMappingData ( attributeName,
type = RelatedModelValueTypeMappingRuleForm::ZURMO_MODEL_ID 
) [static]
Parameters:
string $attributeName
$type 
Returns:
array

Definition at line 356 of file ImportMappingUtil.php.

static makeModelDerivedColumnMappingData ( derivedAttributeName,
type = IdValueTypeMappingRuleForm::EXTERNAL_SYSTEM_ID 
) [static]
Parameters:
string $derivedAttributeName
$type 
Returns:
array

Definition at line 370 of file ImportMappingUtil.php.

static makeStringColumnMappingData ( attributeName,
defaultValue = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
Returns:
array

Definition at line 385 of file ImportMappingUtil.php.

static makeTextAreaColumnMappingData ( attributeName  )  [static]
Parameters:
string $attributeName
Returns:
array

Definition at line 398 of file ImportMappingUtil.php.

static makeUrlColumnMappingData ( attributeName,
defaultValue = null 
) [static]
Parameters:
string $attributeName
null $defaultValue
Returns:
array

Definition at line 409 of file ImportMappingUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon May 29 07:10:25 2017