| +-------------------------------------------------------------------------+ */ class enigma_error { private $code; private $message; private $data = array(); // error codes const OK = 0; const INTERNAL = 1; const NODATA = 2; const KEYNOTFOUND = 3; const DELKEY = 4; const BADPASS = 5; const EXPIRED = 6; const UNVERIFIED = 7; const NOMDC = 8; function __construct($code = null, $message = '', $data = array()) { $this->code = $code; $this->message = $message; $this->data = $data; } function getCode() { return $this->code; } function getMessage() { return $this->message; } function getData($name) { return $name ? $this->data[$name] : $this->data; } }