diff options
author | wei <> | 2006-04-14 06:22:09 +0000 |
---|---|---|
committer | wei <> | 2006-04-14 06:22:09 +0000 |
commit | 3d3f8d3832921f99daf8ce1953304763c2e76c62 (patch) | |
tree | e1b0a9bc3a13fccd253770fb452ac96cc6315121 /framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php | |
parent | 373d8acc503b94ea09823f49e2ab5e395eccc584 (diff) |
Importing SQLMap + sample + docs.
Diffstat (limited to 'framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php')
-rw-r--r-- | framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php b/framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php new file mode 100644 index 00000000..7cb74244 --- /dev/null +++ b/framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php @@ -0,0 +1,65 @@ +<?php
+
+class TDataMapperException extends TException
+{
+ /**
+ * @return string path to the error message file
+ */
+ protected function getErrorMessageFile()
+ {
+ $lang=Prado::getPreferredLanguage();
+ $msgFile=Prado::getFrameworkPath().'/DataAccess/SQLMap/DataMapper/messages-'.$lang.'.txt';
+ if(!is_file($msgFile))
+ $msgFile=Prado::getFrameworkPath().'/DataAccess/SQLMap/DataMapper/messages.txt';
+ return $msgFile;
+ }
+}
+
+class TSqlMapConfigurationException extends TDataMapperException
+{
+
+}
+
+class TUndefinedAttributeException extends TSqlMapConfigurationException
+{
+ public function __construct($attr, $node, $object, $file)
+ {
+ parent::__construct(
+ 'sqlmap_undefined_attribute', get_class($object), $attr,
+ htmlentities($node->asXml()),$file);
+ }
+}
+
+class TSqlMapExecutionException extends TDataMapperException
+{
+}
+
+class TSqlMapQueryExecutionException extends TSqlMapExecutionException
+{
+ protected $parent;
+ public function __construct($statement, $exception)
+ {
+ $this->parent = $exception;
+ parent::__construct('sqlmap_query_execution_error',
+ $statement->getID(), $exception->getMessage());
+ }
+}
+
+class TSqlMapUndefinedException extends TDataMapperException
+{
+
+}
+
+class TSqlMapDuplicateException extends TDataMapperException
+{
+}
+
+class TSqlMapConnectionException extends TDataMapperException
+{
+}
+
+class TInvalidPropertyException extends TDataMapperException
+{
+
+}
+?>
\ No newline at end of file |