00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 class Mage_Core_Controller_Varien_Exception extends Exception
00032 {
00033 const RESULT_FORWARD = '_forward';
00034 const RESULT_REDIRECT = '_redirect';
00035
00036 protected $_resultCallback = null;
00037 protected $_resultCallbackParams = array();
00038 protected $_defaultActionName = 'noroute';
00039 protected $_flags = array();
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 public function prepareForward($actionName = null, $controllerName = null, $moduleName = null, array $params = array())
00051 {
00052 $this->_resultCallback = self::RESULT_FORWARD;
00053 if (null === $actionName) {
00054 $actionName = $this->_defaultActionName;
00055 }
00056 $this->_resultCallbackParams = array($actionName, $controllerName, $moduleName, $params);
00057 return $this;
00058 }
00059
00060
00061
00062
00063
00064
00065
00066
00067 public function prepareRedirect($path, $arguments = array())
00068 {
00069 $this->_resultCallback = self::RESULT_REDIRECT;
00070 $this->_resultCallbackParams($path, $arguments);
00071 return $this;
00072 }
00073
00074
00075
00076
00077
00078
00079
00080 public function prepareFork($actionName = null)
00081 {
00082 if (null === $actionName) {
00083 $actionName = $this->_defaultActionName;
00084 }
00085 $this->_resultCallback = $actionName;
00086 return $this;
00087 }
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 public function prepareFlag($action, $flag, $value)
00098 {
00099 $this->_flags[] = array($action, $flag, $value);
00100 return $this;
00101 }
00102
00103
00104
00105
00106
00107
00108 public function getResultFlags()
00109 {
00110 return $this->_flags;
00111 }
00112
00113
00114
00115
00116
00117
00118 public function getResultCallback()
00119 {
00120 if (null === $this->_resultCallback) {
00121 $this->prepareFork();
00122 }
00123 return array($this->_resultCallback, $this->_resultCallbackParams);
00124 }
00125 }