}
}
else {
- // get the existing batch values from cache table
- $cacheKeyString = CRM_Batch_BAO_Batch::getCacheKeyForBatch($this->_batchId);
- $defaults = CRM_Core_BAO_Cache::getItem('batch entry', $cacheKeyString);
+ // get the cached info from data column of civicrm_batch
+ $data = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', $this->_batchId, 'data');
+ $defaults = json_decode($data, TRUE);
}
+
return $defaults;
}
* Save record
*/
function batchSave() {
- // save in cache table
+ // save the entered information in 'data' column
$batchId = CRM_Utils_Type::escape($_POST['batch_id'], 'Positive');
- $cacheKeyString = CRM_Batch_BAO_Batch::getCacheKeyForBatch($batchId);
-
- // check if we can retrieve from database cache
unset($_POST['qfKey']);
- CRM_Core_BAO_Cache::setItem($_POST, 'batch entry', $cacheKeyString);
+ CRM_Core_DAO::setFieldValue('CRM_Batch_DAO_Batch', $batchId, 'data', json_encode($_POST));
- // return true if saved correctly
CRM_Utils_System::civiExit();
}