oxexceptiontodisplay.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class oxExceptionToDisplay implements oxDisplayErrorInterface
00008 {
00009 
00015     private $_sMessage;
00016 
00022     protected $_blDebug = false;
00023 
00029     private $_sStackTrace;
00030 
00036     private $_aValues;
00037 
00043     private $_sType;
00044 
00045     public function setStackTrace($sStackTrace)
00046     {
00047         $this->_sStackTrace = $sStackTrace;
00048     }
00049 
00050     public function getStackTrace()
00051     {
00052         return $this->_sStackTrace;
00053     }
00054 
00055     public function setValues( $aValues )
00056     {
00057         $this->_aValues = $aValues;
00058     }
00059 
00060     public function addValue( $sName, $sValue )
00061     {
00062         $this->_aValues[$sName] = $sValue;
00063     }
00064 
00065     public function setExceptionType( $sType )
00066     {
00067         $this->_sType = $sType;
00068     }
00069 
00070     public function getErrorClassType()
00071     {
00072         return $this->_sType;
00073     }
00074 
00075     public function getValue( $sName )
00076     {
00077         return $this->_aValues[$sName];
00078     }
00079 
00080     public function setDebug( $bl )
00081     {
00082         $this->_blDebug = $bl;
00083     }
00084 
00085     public function setMessage($sMessage)
00086     {
00087         $this->_sMessage = $sMessage;
00088     }
00089 
00090     public function getOxMessage()
00091     {
00092         return $this->_blDebug ? $this : oxLang::getInstance()->translateString($this->_sMessage);
00093     }
00094 
00095    public function __toString()
00096    {
00097        $sRes = $this->getErrorClassType() . " (time: " . date('Y-m-d H:i:s') . "): " . $this->getOxMessage() . " \n Stack Trace: " . $this->getStackTrace() . "\n";
00098        foreach($this->_aValues as $key => $value) {
00099            $sRes .= $key. " => ". $value . "\n";
00100        }
00101        return $sRes;
00102    }
00103 }

Generated on Thu Dec 4 12:04:56 2008 for OXID eShop CE by  doxygen 1.5.5