projects
/
racktables
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb438b4
)
r2839 - welcome class NotUniqueException
author
Denis Ovsienko
<infrastation@yandex.ru>
Thu, 11 Jun 2009 12:27:04 +0000
(12:27 +0000)
committer
Denis Ovsienko
<infrastation@yandex.ru>
Thu, 11 Jun 2009 12:27:04 +0000
(12:27 +0000)
inc/exceptions.php
patch
|
blob
|
blame
|
history
diff --git
a/inc/exceptions.php
b/inc/exceptions.php
index 01ff2b9d764054a4854da3d2e5faddcfa6c6e1ab..8cde788d5822a684c6599dd4cc7b0bee43dad8e1 100644
(file)
--- a/
inc/exceptions.php
+++ b/
inc/exceptions.php
@@
-18,3
+18,17
@@
class EntityNotFoundException extends Exception {
return $this->id;
}
}
+
+class NotUniqueException extends Exception
+{
+ function __construct ($subject = NULL)
+ {
+ parent::__construct ('Cannot add duplicate record' . ($subject === NULL ? '' : " (${subject} must be unique)"));
+ }
+ function getSubject()
+ {
+ return $this->subject;
+ }
+}
+
+?>