OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
exceptionerror.php
Go to the documentation of this file.
1 <?php
2 
6 class ExceptionError extends oxUBase
7 {
12  protected $_sThisTemplate = 'message/exception.tpl';
13 
19  public function displayExceptionError()
20  {
21  $aViewData = $this->getViewData();
22 
23  //add all exceptions to display
24  $aErrors = $this->_getErrors();
25 
26  if ( is_array( $aErrors ) && count( $aErrors ) ) {
27  oxRegistry::get("oxUtilsView")->passAllErrorsToView( $aViewData, $aErrors );
28  }
29 
30  $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty();
31  $oSmarty->assign_by_ref( "Errors", $aViewData["Errors"] );
32 
33  // resetting errors from session
34  oxSession::setVar( 'Errors', array() );
35  }
36 
42  protected function _getErrors()
43  {
44  $aErrors = oxSession::getVar( 'Errors' );
45 
46  if (null === $aErrors) {
47  $aErrors = array();
48  }
49 
50  return $aErrors;
51  }
52 }