Mage_Dataflow_Model_Batch Class Reference

Inheritance diagram for Mage_Dataflow_Model_Batch:

Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 getFieldList ()
 parseFieldList ($row)
 getIoAdapter ()
 getBatchExportModel ()
 getBatchImportModel ()
 beforeFinish ()
 setParams ($data)
 getParams ()

Public Attributes

const LIFETIME = 86400

Protected Member Functions

 _construct ()
 _beforeSave ()
 _afterDelete ()

Protected Attributes

 $_fieldList = array()
 $_ioAdapter
 $_batchExport
 $_batchImport


Detailed Description

Definition at line 35 of file Batch.php.


Member Function Documentation

_afterDelete (  )  [protected]

Processing object after delete data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 126 of file Batch.php.

00127     {
00128         $this->getIoAdapter()->clear();
00129     }

_beforeSave (  )  [protected]

Processing object before save data

Returns:
Mage_Core_Model_Abstract

Reimplemented from Mage_Core_Model_Abstract.

Definition at line 119 of file Batch.php.

00120     {
00121         if (is_null($this->getData('created_at'))) {
00122             $this->setData('created_at', Mage::getSingleton('core/date')->gmtDate());
00123         }
00124     }

_construct (  )  [protected]

Init model

Reimplemented from Varien_Object.

Definition at line 75 of file Batch.php.

00076     {
00077         $this->_init('dataflow/batch');
00078     }

beforeFinish (  ) 

Run finish actions for Adapter

Definition at line 165 of file Batch.php.

00166     {
00167         if ($this->getAdapter()) {
00168             $adapter = Mage::getModel($this->getAdapter());
00169             if (method_exists($adapter, 'finish')) {
00170                 $adapter->finish();
00171             }
00172         }
00173     }

getBatchExportModel (  ) 

Retrieve Batch export model

Returns:
Mage_Dataflow_Model_Batch_Export

Definition at line 136 of file Batch.php.

00137     {
00138         if (is_null($this->_batchExport)) {
00139             $object = Mage::getModel('dataflow/batch_export');
00140             $object->setBatchId($this->getId());
00141             $this->_batchExport = Varien_Object_Cache::singleton()->save($object);
00142         }
00143         return Varien_Object_Cache::singleton()->load($this->_batchExport);
00144     }

getBatchImportModel (  ) 

Retrieve Batch import model

Returns:
Mage_Dataflow_Model_Import_Export

Definition at line 151 of file Batch.php.

00152     {
00153         if (is_null($this->_batchImport)) {
00154             $object = Mage::getModel('dataflow/batch_import');
00155             $object->setBatchId($this->getId());
00156             $this->_batchImport = Varien_Object_Cache::singleton()->save($object);
00157         }
00158         return Varien_Object_Cache::singleton()->load($this->_batchImport);
00159     }

getFieldList (  ) 

Retrieve prepared field list

Returns:
array

Definition at line 85 of file Batch.php.

00086     {
00087         return $this->_fieldList;
00088     }

getIoAdapter (  ) 

Retrieve Io Adapter

Returns:
Mage_Dataflow_Model_Batch_Io

Definition at line 110 of file Batch.php.

00111     {
00112         if (is_null($this->_ioAdapter)) {
00113             $this->_ioAdapter = Mage::getModel('dataflow/batch_io');
00114             $this->_ioAdapter->init($this);
00115         }
00116         return $this->_ioAdapter;
00117     }

getParams (  ) 

Retrieve additional params return unserialize data

Returns:
mixed

Definition at line 194 of file Batch.php.

00195     {
00196         $data = $this->_data['params'];
00197         $data = unserialize($data);
00198         return $data;
00199     }

parseFieldList ( row  ) 

Parse row fields

Parameters:
array $row

Definition at line 95 of file Batch.php.

00096     {
00097         foreach ($row as $fieldName => $value) {
00098             if (!in_array($fieldName, $this->_fieldList)) {
00099                 $this->_fieldList[$fieldName] = $fieldName;
00100             }
00101         }
00102         unset($fieldName, $value, $row);
00103     }

setParams ( data  ) 

Set additional params automatic convert to serialize data

Parameters:
mixed $data
Returns:
Mage_Dataflow_Model_Batch_Abstract

Definition at line 182 of file Batch.php.

00183     {
00184         $this->setData('params', serialize($data));
00185         return $this;
00186     }


Member Data Documentation

$_batchExport [protected]

Definition at line 62 of file Batch.php.

$_batchImport [protected]

Definition at line 69 of file Batch.php.

$_fieldList = array() [protected]

Definition at line 48 of file Batch.php.

$_ioAdapter [protected]

Definition at line 55 of file Batch.php.

const LIFETIME = 86400

Lifetime abandoned batches

Definition at line 41 of file Batch.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:04 2009 for Magento by  doxygen 1.5.8