diff --git a/src/app/code/community/AvS/FastSimpleImport/Model/Resource/Import/Data.php b/src/app/code/community/AvS/FastSimpleImport/Model/Resource/Import/Data.php new file mode 100644 index 00000000..afc170cb --- /dev/null +++ b/src/app/code/community/AvS/FastSimpleImport/Model/Resource/Import/Data.php @@ -0,0 +1,35 @@ + + * @license http://opensource.org/licenses/osl-3.0.php Open Software Licence 3.0 (OSL-3.0) + * @link https://github.com/AOEpeople/AvS_FastSimpleImport + */ +class AvS_FastSimpleImport_Model_Resource_Import_Data extends Mage_ImportExport_Model_Resource_Import_Data { + + /** + * Save import rows bunch. + * + * @param string $entity + * @param string $behavior + * @param array $data + * @return int + * @throws Exception + */ + public function saveBunch($entity, $behavior, array $data) + { + $json = Mage::helper('core')->jsonEncode($data); + if (false === $json) { + $error = json_last_error_msg(); + throw new Exception(sprintf('Error encoding data for save: %s', $error)); + } + return $this->_getWriteAdapter()->insert( + $this->getMainTable(), + array('behavior' => $behavior, 'entity' => $entity, 'data' => $json) + ); + } +} diff --git a/src/app/code/community/AvS/FastSimpleImport/etc/config.xml b/src/app/code/community/AvS/FastSimpleImport/etc/config.xml index 37401191..a396646d 100644 --- a/src/app/code/community/AvS/FastSimpleImport/etc/config.xml +++ b/src/app/code/community/AvS/FastSimpleImport/etc/config.xml @@ -24,6 +24,11 @@ AvS_FastSimpleImport_Model_Import_Entity_Product + + + AvS_FastSimpleImport_Model_Resource_Import_Data + +