From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../Data/SqlMap/DataMapper/TSqlMapException.php | 230 ++++++++++----------- 1 file changed, 115 insertions(+), 115 deletions(-) (limited to 'framework/Data/SqlMap/DataMapper/TSqlMapException.php') diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapException.php b/framework/Data/SqlMap/DataMapper/TSqlMapException.php index 0bf0ac32..694774d8 100644 --- a/framework/Data/SqlMap/DataMapper/TSqlMapException.php +++ b/framework/Data/SqlMap/DataMapper/TSqlMapException.php @@ -1,115 +1,115 @@ - - * @version $Id$ - * @package System.Data.SqlMap - * @since 3.1 - */ -class TSqlMapException extends TException -{ - /** - * Constructor, similar to the parent constructor. For parameters that - * are of SimpleXmlElement, the tag name and its attribute names and values - * are expanded into a string. - */ - public function __construct($errorMessage) - { - $this->setErrorCode($errorMessage); - $errorMessage=$this->translateErrorMessage($errorMessage); - $args=func_get_args(); - array_shift($args); - $n=count($args); - $tokens=array(); - for($i=0;$i<$n;++$i) - { - if($args[$i] instanceof SimpleXmlElement) - $tokens['{'.$i.'}']=$this->implodeNode($args[$i]); - else - $tokens['{'.$i.'}']=TPropertyValue::ensureString($args[$i]); - } - parent::__construct(strtr($errorMessage,$tokens)); - } - - /** - * @param SimpleXmlElement node - * @return string tag name and attribute names and values. - */ - protected function implodeNode($node) - { - $attributes=array(); - foreach($node->attributes() as $k=>$v) - $attributes[]=$k.'="'.(string)$v.'"'; - return '<'.$node->getName().' '.implode(' ',$attributes).'>'; - } - - /** - * @return string path to the error message file - */ - protected function getErrorMessageFile() - { - $lang=Prado::getPreferredLanguage(); - $dir=dirname(__FILE__); - $msgFile=$dir.'/messages-'.$lang.'.txt'; - if(!is_file($msgFile)) - $msgFile=$dir.'/messages.txt'; - return $msgFile; - } -} - -/** - * TSqlMapConfigurationException, raised during configuration file parsing. - * - * @author Wei Zhuo - * @version $Id$ - * @package System.Data.SqlMap - * @since 3.1 - */ -class TSqlMapConfigurationException extends TSqlMapException -{ - -} - -/** - * TSqlMapUndefinedException, raised when mapped statemented are undefined. - * - * @author Wei Zhuo - * @version $Id$ - * @package System.Data.SqlMap - * @since 3.1 - */ -class TSqlMapUndefinedException extends TSqlMapException -{ - -} - -/** - * TSqlMapDuplicateException, raised when a duplicate mapped statement is found. - * - * @author Wei Zhuo - * @version $Id$ - * @package System.Data.SqlMap - * @since 3.1 - */ -class TSqlMapDuplicateException extends TSqlMapException -{ -} - -/** - * TInvalidPropertyException, raised when setting or getting an invalid property. - * - * @author Wei Zhuo - * @version $Id$ - * @package System.Data.SqlMap - * @since 3.1 - */ -class TInvalidPropertyException extends TSqlMapException -{ -} - -class TSqlMapExecutionException extends TSqlMapException -{ -} - + + * @version $Id$ + * @package System.Data.SqlMap + * @since 3.1 + */ +class TSqlMapException extends TException +{ + /** + * Constructor, similar to the parent constructor. For parameters that + * are of SimpleXmlElement, the tag name and its attribute names and values + * are expanded into a string. + */ + public function __construct($errorMessage) + { + $this->setErrorCode($errorMessage); + $errorMessage=$this->translateErrorMessage($errorMessage); + $args=func_get_args(); + array_shift($args); + $n=count($args); + $tokens=array(); + for($i=0;$i<$n;++$i) + { + if($args[$i] instanceof SimpleXmlElement) + $tokens['{'.$i.'}']=$this->implodeNode($args[$i]); + else + $tokens['{'.$i.'}']=TPropertyValue::ensureString($args[$i]); + } + parent::__construct(strtr($errorMessage,$tokens)); + } + + /** + * @param SimpleXmlElement node + * @return string tag name and attribute names and values. + */ + protected function implodeNode($node) + { + $attributes=array(); + foreach($node->attributes() as $k=>$v) + $attributes[]=$k.'="'.(string)$v.'"'; + return '<'.$node->getName().' '.implode(' ',$attributes).'>'; + } + + /** + * @return string path to the error message file + */ + protected function getErrorMessageFile() + { + $lang=Prado::getPreferredLanguage(); + $dir=dirname(__FILE__); + $msgFile=$dir.'/messages-'.$lang.'.txt'; + if(!is_file($msgFile)) + $msgFile=$dir.'/messages.txt'; + return $msgFile; + } +} + +/** + * TSqlMapConfigurationException, raised during configuration file parsing. + * + * @author Wei Zhuo + * @version $Id$ + * @package System.Data.SqlMap + * @since 3.1 + */ +class TSqlMapConfigurationException extends TSqlMapException +{ + +} + +/** + * TSqlMapUndefinedException, raised when mapped statemented are undefined. + * + * @author Wei Zhuo + * @version $Id$ + * @package System.Data.SqlMap + * @since 3.1 + */ +class TSqlMapUndefinedException extends TSqlMapException +{ + +} + +/** + * TSqlMapDuplicateException, raised when a duplicate mapped statement is found. + * + * @author Wei Zhuo + * @version $Id$ + * @package System.Data.SqlMap + * @since 3.1 + */ +class TSqlMapDuplicateException extends TSqlMapException +{ +} + +/** + * TInvalidPropertyException, raised when setting or getting an invalid property. + * + * @author Wei Zhuo + * @version $Id$ + * @package System.Data.SqlMap + * @since 3.1 + */ +class TInvalidPropertyException extends TSqlMapException +{ +} + +class TSqlMapExecutionException extends TSqlMapException +{ +} + -- cgit v1.2.3