dmBridge PHP API
DMErrorException.php
00001 <?php
00002 #
00003 # dmBridge: a data access framework for CONTENTdm(R)
00004 # Copyright © 2009, 2010 Board of Regents of the Nevada System of Higher
00005 # Education, on behalf of the University of Nevada, Las Vegas
00006 #
00007 
00012 class DMErrorException extends ErrorException implements DMLoggable {
00013 
00015    private $has_been_logged = false;
00016 
00018    private $http_response_code = 500;
00019 
00021    private $timestamp;
00022 
00023 
00029    public function __construct($msg = null, $code = 3) {
00030       ini_set('xdebug.remote_mode', 'jit');
00031       parent::__construct($msg, $code);
00032       $this->setTimestamp(new DMDateTime());
00033    }
00034 
00039    public final function hasBeenLogged() {
00040       return $this->has_been_logged;
00041    }
00042 
00046    public final function setHasBeenLogged($bool) {
00047       $this->has_been_logged = ($bool);
00048    }
00049 
00053    public final function getHTTPResponseCode() {
00054       return $this->http_response_code;
00055    }
00056 
00062    public final function getLogMessage() {
00063       return $this->getMessage();
00064    }
00065 
00071    public final function getLogPriority() {
00072       return $this->getCode();
00073    }
00074 
00080    public function setLogPriority($int) {
00081       $this->setCode($int);
00082    }
00083 
00088    public final function getTimestamp() {
00089       return $this->timestamp;
00090    }
00091 
00092    private function setTimestamp(DMDateTime $dt) {
00093       $this->timestamp = $dt;
00094    }
00095 
00096 }
 All Data Structures Functions Variables