diff options
author | xue <> | 2006-05-29 03:08:07 +0000 |
---|---|---|
committer | xue <> | 2006-05-29 03:08:07 +0000 |
commit | 2ea02214b2fb6bedb58dbbd318ef171a9e146524 (patch) | |
tree | 16b12d9f68986fe204900d1cee4914a0a4035a7b /demos/blog/protected/Common/BlogErrors.php | |
parent | 8c1edb7f4eced999c9704ec9ff7ba11d88248bbd (diff) |
Merge from 3.0 branch till 1099.
Diffstat (limited to 'demos/blog/protected/Common/BlogErrors.php')
-rw-r--r-- | demos/blog/protected/Common/BlogErrors.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/demos/blog/protected/Common/BlogErrors.php b/demos/blog/protected/Common/BlogErrors.php new file mode 100644 index 00000000..501ec1c9 --- /dev/null +++ b/demos/blog/protected/Common/BlogErrors.php @@ -0,0 +1,23 @@ +<?php
+
+class BlogErrors
+{
+ const ERROR_UKNOWN=0;
+ const ERROR_POST_NOT_FOUND=1;
+ const ERROR_USER_NOT_FOUND=2;
+ const ERROR_PERMISSION_DENIED=3;
+
+ private static $_errorMessages=array(
+ self::ERROR_UKNOWN=>'Unknown error.',
+ self::ERROR_POST_NOT_FOUND=>'The specified post cannot be found.',
+ self::ERROR_USER_NOT_FOUND=>'The specified user account cannot be found.',
+ self::ERROR_PERMISSION_DENIED=>'Sorry, you do not have permission to perform this action.',
+ );
+
+ public static function getMessage($errorCode)
+ {
+ return isset(self::$_errorMessages[$errorCode])?self::$_errorMessages[$errorCode]:self::$_errorMessages[0];
+ }
+}
+
+?>
\ No newline at end of file |