OXID eShop CE  4.10.7
 All Classes Namespaces Files Functions Variables Pages
exceptionerror.php
Go to the documentation of this file.
1 <?php
2 
6 class ExceptionError extends oxUBase
7 {
8 
14  protected $_sThisTemplate = 'message/exception.tpl';
15 
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  oxRegistry::getSession()->setVariable('Errors', array());
35  }
36 
42  protected function _getErrors()
43  {
44  $aErrors = oxRegistry::getSession()->getVariable('Errors');
45 
46  if (null === $aErrors) {
47  $aErrors = array();
48  }
49 
50  return $aErrors;
51  }
52 }