summaryrefslogtreecommitdiffstats
path: root/common/app/classes/PlanetError.php
diff options
context:
space:
mode:
Diffstat (limited to 'common/app/classes/PlanetError.php')
-rw-r--r--common/app/classes/PlanetError.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/app/classes/PlanetError.php b/common/app/classes/PlanetError.php
new file mode 100644
index 0000000..31923a3
--- /dev/null
+++ b/common/app/classes/PlanetError.php
@@ -0,0 +1,23 @@
+<?php
+
+class PlanetError
+{
+ public $level;
+ public $message;
+
+ public function __construct($level, $message)
+ {
+ $this->level = (int) $level;
+ $this->message = $message;
+ }
+
+ public function toString($format = '%1$s : %2$s')
+ {
+ $levels = array(
+ 1 => 'notice',
+ 2 => 'warning',
+ 3 => 'error',
+ );
+ return sprintf($format, $levels[$this->level], $this->message);
+ }
+}