/**
  * @param int      $code
  * @param string   $method
  * @param string   $linenumber
  * @param UserData $user
  * @param array    $data
  * @param null     $exception
  * @param int      $httpResponseCode
  *
  * @internal param string $filename
  */
 public function __construct($code, $method = '', $linenumber = '', UserData $user, $data = array(), $exception = null, $httpResponseCode = 200)
 {
     parent::__construct($code, $method, $linenumber, $data, $exception, $httpResponseCode);
     $this->user = $user;
 }
Exemple #2
0
 public function __construct($field, $value, array $messages = array())
 {
     $data = array('field' => $field, 'value' => is_array($value) ? json_encode($value) : $value);
     parent::__construct(3, __METHOD__, __LINE__, $data);
     $this->message = $this->message . ' - ' . $this->getMessagesAsString($messages);
 }
 private function handelTicketError(CmsException $e)
 {
     // XHR or browser
     if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
         // show json error
         throw $e;
     }
     // show html error
     if ($e instanceof InvalidTicketException) {
         $this->getResponse()->setHttpResponseCode(403);
     } else {
         $this->getResponse()->setHttpResponseCode(400);
     }
     $this->_helper->viewRenderer->setNoRender(false);
     $this->contentTypeValue = 'text/html';
     $this->view->errorMessage = $e->getMessage();
     $this->view->useClientTemplate = realpath(Registry::getConfig()->client->template->error);
     return;
 }