ImportWizardUtil Class Reference

Static Public Member Functions

static makeFormByImport ($import)
static setFormByPostForStep1 ($importWizardForm, $postData)
static setFormByPostForStep2 ($importWizardForm, $postData)
static setFormByPostForStep3 ($importWizardForm, $postData)
static setFormByPostForStep4 ($importWizardForm, $postData)
static setFormByFileUploadDataAndTableName ($importWizardForm, $fileUploadData, $tableName)
static setImportSerializedDataFromForm ($importWizardForm, $import)
static clearFileAndRelatedDataFromImport ($import)
static importFileHasAtLeastOneImportRow ($importWizardForm, $import)

Detailed Description

Helper class with import wizard related functions.

Definition at line 40 of file ImportWizardUtil.php.


Member Function Documentation

static makeFormByImport ( import  )  [static]

Given an import object, make an ImportWizardForm, mapping the attributes from the import object into the form.

Parameters:
object $import

Definition at line 59 of file ImportWizardUtil.php.

static setFormByPostForStep1 ( importWizardForm,
postData 
) [static]

Given a form and an array of post data, set the form for the step 1 process. If the importRulesType is already set and the new value is different, all other form attribute values should be emptied since this means the importRulesType is different and for the next steps, we can't use existing saved data.

Parameters:
object $importWizardForm
array $postData

Definition at line 95 of file ImportWizardUtil.php.

static setFormByPostForStep2 ( importWizardForm,
postData 
) [static]

Step 2 is where the import file is uploaded and the user checks if the first column is a header row.

Parameters:
object $importWizardForm
array $postData

Definition at line 115 of file ImportWizardUtil.php.

static setFormByPostForStep3 ( importWizardForm,
postData 
) [static]

Step 3 is where the explicit permissions are decided for the models that will be imported.

Parameters:
object $importWizardForm
array $postData

Definition at line 132 of file ImportWizardUtil.php.

static setFormByPostForStep4 ( importWizardForm,
postData 
) [static]

Step 4 is where the import mapping is done along with any mapping rules.

Parameters:
object $importWizardForm
array $postData

Definition at line 146 of file ImportWizardUtil.php.

static setFormByFileUploadDataAndTableName ( importWizardForm,
fileUploadData,
tableName 
) [static]

Given an array of file upload data, set the form from this. Keep the existing importRulesType value but clear out any other form attributes since with a new file uploaded, those other attribute values will need to be redone.

Parameters:
object $importWizardForm
array $fileUploadData

Definition at line 160 of file ImportWizardUtil.php.

static setImportSerializedDataFromForm ( importWizardForm,
import 
) [static]

Based on the self::$importToFormAttributeMap, create an array of elements from the import wizard form. Serialize the array and set the import serializedData attribute.

Parameters:
object $importWizardForm
object $import

Definition at line 190 of file ImportWizardUtil.php.

static clearFileAndRelatedDataFromImport ( import  )  [static]

Use this method to remove the existing temp table associated with this import model. Will also remove data from serializedData that is created after a file is normally attached to an import model. It will leave the importRulesType in place since that is created prior to uploading a new file.

Parameters:
object $import model.

Definition at line 212 of file ImportWizardUtil.php.

static importFileHasAtLeastOneImportRow ( importWizardForm,
import 
) [static]

Given an importWizardForm and an import object, ascertain whether there is a sufficient number of rows to do an import. If there is a header row present, then the minimum row count must be 2, otherwise it only has to be 1.

Parameters:
object $importWizardForm
object $import
Returns:
boolean true/false

Definition at line 233 of file ImportWizardUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Nov 26 07:10:26 2014