Mage_Dataflow_Model_Convert_Container_Abstract Class Reference

Inheritance diagram for Mage_Dataflow_Model_Convert_Container_Abstract:

Mage_Dataflow_Model_Convert_Container_Interface Mage_Dataflow_Model_Convert_Adapter_Abstract Mage_Dataflow_Model_Convert_Container_Generic Mage_Dataflow_Model_Convert_Mapper_Abstract Mage_Dataflow_Model_Convert_Parser_Abstract Mage_Dataflow_Model_Convert_Validator_Abstract Mage_Catalog_Model_Convert_Adapter_Catalog Mage_Dataflow_Model_Convert_Adapter_Db_Table Mage_Dataflow_Model_Convert_Adapter_Http Mage_Dataflow_Model_Convert_Adapter_Http_Curl Mage_Dataflow_Model_Convert_Adapter_Io Mage_Dataflow_Model_Convert_Adapter_Soap Mage_Dataflow_Model_Convert_Adapter_Std Mage_Dataflow_Model_Convert_Adapter_Zend_Cache Mage_Dataflow_Model_Convert_Adapter_Zend_Db Mage_Dataflow_Model_Convert_Iterator_Http Mage_Dataflow_Model_Session_Adapter_Http Mage_Dataflow_Model_Session_Adapter_Iterator Mage_Eav_Model_Convert_Adapter_Entity Mage_Eav_Model_Convert_Adapter_Grid Mage_Dataflow_Model_Convert_Mapper_Column Mage_Dataflow_Model_Convert_Iterator_File_Csv Mage_Dataflow_Model_Convert_Parser_Csv Mage_Dataflow_Model_Convert_Parser_Serialize Mage_Dataflow_Model_Convert_Parser_Xml_Excel Mage_Dataflow_Model_Session_Parser_Csv Mage_Eav_Model_Convert_Parser_Abstract Mage_Dataflow_Model_Convert_Validator_Column Mage_Dataflow_Model_Convert_Validator_Dryrun

List of all members.

Public Member Functions

 getVar ($key, $default=null)
 getVars ()
 setVar ($key, $value=null)
 getAction ()
 setAction (Mage_Dataflow_Model_Convert_Action_Interface $action)
 getProfile ()
 setProfile (Mage_Dataflow_Model_Convert_Profile_Interface $profile)
 getData ()
 setData ($data)
 validateDataString ($data=null)
 validateDataArray ($data=null)
 validateDataGrid ($data=null)
 getGridFields ($grid)
 addException ($error, $level=null)
 getPosition ()
 setPosition ($position)
 setBatchParams ($data)
 getBatchParams ($key=null)

Protected Attributes

 $_batchParams = array()
 $_vars
 $_profile
 $_action
 $_data
 $_position


Detailed Description

Definition at line 35 of file Abstract.php.


Member Function Documentation

addException ( error,
level = null 
)

Definition at line 161 of file Abstract.php.

00162     {
00163         $e = new Mage_Dataflow_Model_Convert_Exception($error);
00164         $e->setLevel(!is_null($level) ? $level : Mage_Dataflow_Model_Convert_Exception::NOTICE);
00165         $e->setContainer($this);
00166         $e->setPosition($this->getPosition());
00167 
00168         if ($this->getProfile()) {
00169             $this->getProfile()->addException($e);
00170         }
00171 
00172         return $e;
00173     }

getAction (  ) 

Definition at line 73 of file Abstract.php.

00074     {
00075         return $this->_action;
00076     }

getBatchParams ( key = null  ) 

Definition at line 194 of file Abstract.php.

00195     {
00196         if (!empty($key)) {
00197             return isset($this->_batchParams[$key]) ? $this->_batchParams[$key] : null;
00198         }
00199         return $this->_batchParams;
00200     }

getData (  ) 

Definition at line 95 of file Abstract.php.

00096     {
00097         if (is_null($this->_data) && $this->getProfile()) {
00098             $this->_data = $this->getProfile()->getContainer()->getData();
00099         }
00100         return $this->_data;
00101     }

getGridFields ( grid  ) 

Definition at line 148 of file Abstract.php.

00149     {
00150         $fields = array();
00151         foreach ($grid as $i=>$row) {
00152             foreach ($row as $fieldName=>$data) {
00153                 if (!in_array($fieldName, $fields)) {
00154                     $fields[] = $fieldName;
00155                 }
00156             }
00157         }
00158         return $fields;
00159     }

getPosition (  ) 

Definition at line 175 of file Abstract.php.

00176     {
00177         return $this->_position;
00178     }

getProfile (  ) 

Definition at line 84 of file Abstract.php.

00085     {
00086         return $this->_profile;
00087     }

getVar ( key,
default = null 
)

Definition at line 50 of file Abstract.php.

00051     {
00052         if (!isset($this->_vars[$key]) || (!is_array($this->_vars[$key]) && strlen($this->_vars[$key]) == 0)) {
00053             return $default;
00054         }
00055         return $this->_vars[$key];
00056     }

getVars (  ) 

Definition at line 58 of file Abstract.php.

00059     {
00060         return $this->_vars;
00061     }

setAction ( Mage_Dataflow_Model_Convert_Action_Interface action  ) 

Definition at line 78 of file Abstract.php.

00079     {
00080         $this->_action = $action;
00081         return $this;
00082     }

setBatchParams ( data  ) 

Definition at line 186 of file Abstract.php.

00187     {
00188         if (is_array($data)) {
00189             $this->_batchParams = $data;
00190         }
00191         return $this;
00192     }

setData ( data  ) 

Definition at line 103 of file Abstract.php.

00104     {
00105         if ($this->getProfile()) {
00106             $this->getProfile()->getContainer()->setData($data);
00107         }
00108         $this->_data = $data;
00109         return $this;
00110     }

setPosition ( position  ) 

Definition at line 180 of file Abstract.php.

00181     {
00182         $this->_position = $position;
00183         return $this;
00184     }

setProfile ( Mage_Dataflow_Model_Convert_Profile_Interface profile  ) 

Definition at line 89 of file Abstract.php.

00090     {
00091         $this->_profile = $profile;
00092         return $this;
00093     }

setVar ( key,
value = null 
)

Definition at line 63 of file Abstract.php.

00064     {
00065         if (is_array($key) && is_null($value)) {
00066             $this->_vars = $key;
00067         } else {
00068             $this->_vars[$key] = $value;
00069         }
00070         return $this;
00071     }

validateDataArray ( data = null  ) 

Definition at line 123 of file Abstract.php.

00124     {
00125         if (is_null($data)) {
00126             $data = $this->getData();
00127         }
00128         if (!is_array($data)) {
00129             $this->addException("Invalid data type, expecting array.", Mage_Dataflow_Model_Convert_Exception::FATAL);
00130         }
00131         return true;
00132     }

validateDataGrid ( data = null  ) 

Definition at line 134 of file Abstract.php.

00135     {
00136         if (is_null($data)) {
00137             $data = $this->getData();
00138         }
00139         if (!is_array($data) || !is_array(current($data))) {
00140             if (count($data)==0) {
00141                 return true;
00142             }
00143             $this->addException("Invalid data type, expecting 2D grid array.", Mage_Dataflow_Model_Convert_Exception::FATAL);
00144         }
00145         return true;
00146     }

validateDataString ( data = null  ) 

Definition at line 112 of file Abstract.php.

00113     {
00114         if (is_null($data)) {
00115             $data = $this->getData();
00116         }
00117         if (!is_string($data)) {
00118             $this->addException("Invalid data type, expecting string.", Mage_Dataflow_Model_Convert_Exception::FATAL);
00119         }
00120         return true;
00121     }


Member Data Documentation

$_action [protected]

Definition at line 44 of file Abstract.php.

$_batchParams = array() [protected]

Definition at line 38 of file Abstract.php.

$_data [protected]

Definition at line 46 of file Abstract.php.

$_position [protected]

Definition at line 48 of file Abstract.php.

$_profile [protected]

Definition at line 42 of file Abstract.php.

$_vars [protected]

Definition at line 40 of file Abstract.php.


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

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