Mage_Dataflow_Model_Convert_Profile_Abstract Class Reference

Inheritance diagram for Mage_Dataflow_Model_Convert_Profile_Abstract:

Mage_Dataflow_Model_Convert_Profile_Interface Mage_Dataflow_Model_Convert_Profile

List of all members.

Public Member Functions

 addAction (Mage_Dataflow_Model_Convert_Action_Interface $action=null)
 setContainers (Mage_Dataflow_Model_Convert_Container_Collection $containers)
 getContainers ()
 getContainer ($name=null)
 addContainer ($name, Mage_Dataflow_Model_Convert_Container_Interface $container)
 getExceptions ()
 getDryRun ()
 setDryRun ($flag)
 addException (Mage_Dataflow_Model_Convert_Exception $e)
 importXml (Varien_Simplexml_Element $profileNode)
 run ()
 setDataflowProfile ($profile)
 getDataflowProfile ()

Protected Attributes

 $_actions
 $_containers
 $_exceptions = array()
 $_dryRun
 $_actionDefaultClass = 'Mage_Dataflow_Model_Convert_Action'
 $_containerCollectionDefaultClass = 'Mage_Dataflow_Model_Convert_Container_Collection'
 $_dataflow_profile = null


Detailed Description

Definition at line 34 of file Abstract.php.


Member Function Documentation

addAction ( Mage_Dataflow_Model_Convert_Action_Interface action = null  ) 

Definition at line 52 of file Abstract.php.

00053     {
00054         if (is_null($action)) {
00055             $action = new $this->_actionDefaultClass();
00056         }
00057         $this->_actions[] = $action;
00058         $action->setProfile($this);
00059         return $action;
00060     }

addContainer ( name,
Mage_Dataflow_Model_Convert_Container_Interface container 
)

Definition at line 84 of file Abstract.php.

00085     {
00086         $container = $this->getContainers()->addItem($name, $container);
00087         $container->setProfile($this);
00088         return $container;
00089     }

addException ( Mage_Dataflow_Model_Convert_Exception e  ) 

Definition at line 107 of file Abstract.php.

00108     {
00109         $this->_exceptions[] = $e;
00110         return $this;
00111     }

getContainer ( name = null  ) 

Definition at line 76 of file Abstract.php.

00077     {
00078         if (is_null($name)) {
00079             $name = '_default';
00080         }
00081         return $this->getContainers()->getItem($name);
00082     }

getContainers (  ) 

Definition at line 68 of file Abstract.php.

00069     {
00070         if (!$this->_containers) {
00071             $this->_containers = new $this->_containerCollectionDefaultClass();
00072         }
00073         return $this->_containers;
00074     }

getDataflowProfile (  ) 

Definition at line 158 of file Abstract.php.

00159     {
00160         return $this->_dataflow_profile;
00161     }

getDryRun (  ) 

Definition at line 96 of file Abstract.php.

00097     {
00098         return $this->_dryRun;
00099     }

getExceptions (  ) 

Definition at line 91 of file Abstract.php.

00092     {
00093         return $this->_exceptions;
00094     }

importXml ( Varien_Simplexml_Element profileNode  ) 

Definition at line 113 of file Abstract.php.

00114     {
00115         foreach ($profileNode->action as $actionNode) {
00116             $action = $profile->addAction();
00117             $action->importXml($actionNode);
00118         }
00119 
00120         return $this;
00121     }

run (  ) 

Run current action

Returns:
Mage_Dataflow_Model_Convert_Profile_Abstract

Implements Mage_Dataflow_Model_Convert_Profile_Interface.

Definition at line 123 of file Abstract.php.

00124     {
00125 //        print '<pre>';
00126 //        print_r($this->_dataflow_profile);
00127 //        print '</pre>';
00128 
00129         if (!$this->_actions) {
00130             $e = new Mage_Dataflow_Model_Convert_Exception("Could not find any actions for this profile");
00131             $e->setLevel(Mage_Dataflow_Model_Convert_Exception::FATAL);
00132             $this->addException($e);
00133             return;
00134         }
00135 
00136         foreach ($this->_actions as $action) {
00137             /* @var $action Mage_Dataflow_Model_Convert_Action */
00138             try {
00139                 $action->run();
00140             }
00141             catch (Exception $e) {
00142                 $dfe = new Mage_Dataflow_Model_Convert_Exception($e->getMessage());
00143                 $dfe->setLevel(Mage_Dataflow_Model_Convert_Exception::FATAL);
00144                 $this->addException($dfe);
00145                 return ;
00146             }
00147         }
00148         return $this;
00149     }

setContainers ( Mage_Dataflow_Model_Convert_Container_Collection containers  ) 

Definition at line 62 of file Abstract.php.

00063     {
00064         $this->_containers = $containers;
00065         return $this;
00066     }

setDataflowProfile ( profile  ) 

Definition at line 151 of file Abstract.php.

00151                                           {
00152         if (is_array($profile)) {
00153             $this->_dataflow_profile = $profile;
00154         }
00155         return $this;
00156     }

setDryRun ( flag  ) 

Definition at line 101 of file Abstract.php.

00102     {
00103         $this->_dryRun = $flag;
00104         return $this;
00105     }


Member Data Documentation

$_actionDefaultClass = 'Mage_Dataflow_Model_Convert_Action' [protected]

Definition at line 46 of file Abstract.php.

$_actions [protected]

Definition at line 38 of file Abstract.php.

$_containerCollectionDefaultClass = 'Mage_Dataflow_Model_Convert_Container_Collection' [protected]

Definition at line 48 of file Abstract.php.

$_containers [protected]

Definition at line 40 of file Abstract.php.

$_dataflow_profile = null [protected]

Definition at line 50 of file Abstract.php.

$_dryRun [protected]

Definition at line 44 of file Abstract.php.

$_exceptions = array() [protected]

Definition at line 42 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