12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- class ErrorResult extends GenericResult {
-
- public static $RESULT_FAIL = -1 ;
- public static $RESULT_FAIL_APIKEY_DISABLED = -30;
- public static $RESULT_FAIL_APIKEY_INACTIVE = -31;
- public static $RESULT_FAIL_APIKEY_INVALID = -32;
-
- public static $RESULT_FAIL_AUTHTOKEN = -20;
-
- public function __construct($message, $code = "", Exception $exception = NULL) {
- if ($code == "") {
- $code = ErrorResult::$RESULT_FAIL;
- }
- if ($exception != NULL) {
- $this->setResult($exception->__toString());
- }
- $this->setStatusCode($code, $message);
- }
-
- public static function getInstance($message, $code = "", Exception $exception = NULL) {
-
- return new ErrorResult($message, $code, $exception);
- }
- }
|