This is being done in order to support as-required downloading of output
csv from the temp table.
(note that viewing the temp table directly rather than down loading might
also be on the cards)
//hack to clean db
//if job complete drop table.
- $importJob->isComplete(TRUE);
+ $importJob->isComplete();
}
}
* Clean up the import table we used.
*/
public function postProcess() {
- $dao = new CRM_Core_DAO();
- $db = $dao->getDatabaseConnection();
-
- $importTableName = $this->get('importTableName');
- // do a basic sanity check here
- if (strpos($importTableName, 'civicrm_import_job_') === 0) {
- $query = "DROP TABLE IF EXISTS $importTableName";
- $db->query($query);
- }
}
}
}
/**
- * @param bool $dropIfComplete
+ * Has the job completed.
*
* @return bool
* @throws Exception
*/
- public function isComplete($dropIfComplete = TRUE) {
+ public function isComplete() {
if (!$this->_statusFieldName) {
throw new CRM_Core_Exception("Could not get name of the import status field");
}
if ($result->fetch()) {
return FALSE;
}
- if ($dropIfComplete) {
- $query = "DROP TABLE $this->_tableName";
- CRM_Core_DAO::executeQuery($query);
- }
return TRUE;
}