Public Member Functions | |
getParam ($key, $default=null) | |
setParam ($key, $value=null) | |
getParams () | |
setParams ($params) | |
getProfile () | |
setProfile (Varien_Convert_Profile_Abstract $profile) | |
setContainer (Varien_Convert_Container_Interface $container) | |
getContainer ($name=null) | |
run () | |
Protected Attributes | |
$_params | |
$_profile | |
$_container |
Definition at line 37 of file Abstract.php.
getContainer | ( | $ | name = null |
) |
Get action's container
string | $name |
Definition at line 157 of file Abstract.php.
00158 { 00159 if (!is_null($name)) { 00160 return $this->getProfile()->getContainer($name); 00161 } 00162 00163 if (!$this->_container) { 00164 $class = $this->getParam('class'); 00165 $this->setContainer(new $class()); 00166 } 00167 return $this->_container; 00168 }
getParam | ( | $ | key, | |
$ | default = null | |||
) |
Get action parameter
string | $key | |
mixed | $default |
Definition at line 69 of file Abstract.php.
00070 { 00071 if (!isset($this->_params[$key])) { 00072 return $default; 00073 } 00074 return $this->_params[$key]; 00075 }
getParams | ( | ) |
getProfile | ( | ) |
Get profile instance the action belongs to
Definition at line 121 of file Abstract.php.
run | ( | ) |
Run current action
Implements Varien_Convert_Action_Interface.
Definition at line 175 of file Abstract.php.
00176 { 00177 if ($method = $this->getParam('method')) { 00178 if (!is_callable(array($this->getContainer(), $method))) { 00179 $this->addException('Unable to run action method: '.$method, Varien_Convert_Exception::FATAL); 00180 } 00181 00182 $this->getContainer()->addException('Starting '.get_class($this->getContainer()).' :: '.$method); 00183 00184 if ($this->getParam('from')) { 00185 $this->getContainer()->setData($this->getContainer($this->getParam('from'))->getData()); 00186 } 00187 00188 $this->getContainer()->$method(); 00189 00190 if ($this->getParam('to')) { 00191 $this->getContainer($this->getParam('to'))->setData($this->getContainer()->getData()); 00192 } 00193 } else { 00194 $this->addException('No method specified', Varien_Convert_Exception::FATAL); 00195 } 00196 return $this; 00197 }
setContainer | ( | Varien_Convert_Container_Interface $ | container | ) |
Set action's container
Varien_Convert_Container_Abstract | $container |
Definition at line 144 of file Abstract.php.
00145 { 00146 $this->_container = $container; 00147 $this->_container->setProfile($this->getProfile()); 00148 return $this; 00149 }
setParam | ( | $ | key, | |
$ | value = null | |||
) |
Set action parameter
string | $key | |
mixed | $value |
Definition at line 84 of file Abstract.php.
00085 { 00086 if (is_array($key) && is_null($value)) { 00087 $this->_params = $key; 00088 } else { 00089 $this->_params[$key] = $value; 00090 } 00091 return $this; 00092 }
setParams | ( | $ | params | ) |
Set all action parameters
array | $params |
Definition at line 110 of file Abstract.php.
setProfile | ( | Varien_Convert_Profile_Abstract $ | profile | ) |
Set profile instance the action belongs to
Varien_Convert_Profile_Abstract | $profile |
Definition at line 132 of file Abstract.php.
$_container [protected] |
Definition at line 60 of file Abstract.php.
$_params [protected] |
Definition at line 46 of file Abstract.php.
$_profile [protected] |
Definition at line 53 of file Abstract.php.