summaryrefslogtreecommitdiff
path: root/framework/DataAccess/SQLMap/DataMapper/TDataMapperException.php
blob: 7cb74244faaa477ce005f5e96c2a97af50d5bc8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
{

}
?>