SQLException Class Reference

List of all members.

Public Member Functions

 __construct ($msg, $native=null, $userinfo=null)
 Constructs a SQLException.
 setUserInfo ($info)
 Sets additional user / debug information for this error.
 getUserInfo ()
 Returns the additional / debug information for this error.
 setNativeError ($msg)
 Sets driver native error message.
 getNativeError ()
 Gets driver native error message.
 toString ()

Protected Attributes

 $userInfo
 Information that provides additional information for context of Exception (e.g.
 $nativeError
 Native RDBMS error string.


Detailed Description

Definition at line 29 of file SQLException.php.


Constructor & Destructor Documentation

SQLException::__construct ( msg,
native = null,
userinfo = null 
)

Constructs a SQLException.

Parameters:
string $msg Error message
string $native Native DB error message.
string $userinfo More info, e.g. the SQL statement or the connection string that caused the error.

Definition at line 43 of file SQLException.php.

References setNativeError(), and setUserInfo().

00044     {
00045         parent::__construct($msg);
00046         if ($native !== null) {
00047             $this->setNativeError($native);
00048         }
00049         if ($userinfo !== null) {
00050             $this->setUserInfo($userinfo);
00051         }
00052     }


Member Function Documentation

SQLException::getNativeError (  ) 

Gets driver native error message.

Returns:
string

Definition at line 93 of file SQLException.php.

00094     {
00095         return $this->nativeError;
00096     }        

SQLException::getUserInfo (  ) 

Returns the additional / debug information for this error.

Returns:
array hash of user info properties.

Definition at line 71 of file SQLException.php.

00072     {
00073         return $this->userInfo;
00074     }

SQLException::setNativeError ( msg  ) 

Sets driver native error message.

Parameters:
string $info
Returns:
void

Definition at line 82 of file SQLException.php.

Referenced by __construct().

00083     {
00084         $this->nativeError = $msg;
00085         $this->message .= " [Native Error: " .$this->nativeError . "]";
00086     }

SQLException::setUserInfo ( info  ) 

Sets additional user / debug information for this error.

Parameters:
array $info
Returns:
void

Definition at line 60 of file SQLException.php.

Referenced by __construct(), and Creole::getConnection().

00061     {
00062         $this->userInfo = $info;
00063         $this->message .= " [User Info: " .$this->userInfo . "]";
00064     }

SQLException::toString (  ) 

Deprecated:
This method only exists right now for easier compatibility w/ PHPUnit!

Definition at line 101 of file SQLException.php.

00102     {
00103         return $this->getMessage();
00104     }


Member Data Documentation

SQLException::$nativeError [protected]

Native RDBMS error string.

Definition at line 35 of file SQLException.php.

SQLException::$userInfo [protected]

Information that provides additional information for context of Exception (e.g.

SQL statement or DSN).

Definition at line 32 of file SQLException.php.


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:10:50 2009 for fareofficelib by  doxygen 1.5.8