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) |
Helper class with import wizard related functions.
Definition at line 30 of file ImportWizardUtil.php.
| static makeFormByImport | ( | $ | import | ) | [static] |
Given an import object, make an ImportWizardForm, mapping the attributes from the import object into the form.
| object | $import |
Definition at line 50 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.
| object | $importWizardForm | |
| array | $postData |
Definition at line 86 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.
| object | $importWizardForm | |
| array | $postData |
Definition at line 106 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.
| object | $importWizardForm | |
| array | $postData |
Definition at line 123 of file ImportWizardUtil.php.
| static setFormByPostForStep4 | ( | $ | importWizardForm, | |
| $ | postData | |||
| ) | [static] |
Step 4 is where the import mapping is done along with any mapping rules. Also clears out dataAnalyzerMessagesData in case it was populated from a previous run.
| object | $importWizardForm | |
| array | $postData |
Definition at line 138 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.
| object | $importWizardForm | |
| array | $fileUploadData |
Definition at line 153 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.
| object | $importWizardForm | |
| object | $import |
Definition at line 183 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.
| object | $import model. |
Definition at line 205 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.
| object | $importWizardForm | |
| object | $import |
Definition at line 226 of file ImportWizardUtil.php.