Overview

Namespaces

  • None
  • RedBeanPHP
    • Adapter
    • BeanHelper
    • Cursor
    • Driver
    • Logger
      • RDefault
    • QueryWriter
    • RedException
    • Repository
    • Util

Classes

  • R
  • RedBean_SimpleModel
  • RedBeanPHP\Adapter\DBAdapter
  • RedBeanPHP\AssociationManager
  • RedBeanPHP\BeanCollection
  • RedBeanPHP\BeanHelper\SimpleFacadeBeanHelper
  • RedBeanPHP\Cursor\NullCursor
  • RedBeanPHP\Cursor\PDOCursor
  • RedBeanPHP\Driver\RPDO
  • RedBeanPHP\DuplicationManager
  • RedBeanPHP\Facade
  • RedBeanPHP\Finder
  • RedBeanPHP\Jsonable
  • RedBeanPHP\LabelMaker
  • RedBeanPHP\Logger\RDefault
  • RedBeanPHP\Logger\RDefault\Debug
  • RedBeanPHP\Observable
  • RedBeanPHP\OODB
  • RedBeanPHP\OODBBean
  • RedBeanPHP\QueryWriter\AQueryWriter
  • RedBeanPHP\QueryWriter\CUBRID
  • RedBeanPHP\QueryWriter\MySQL
  • RedBeanPHP\QueryWriter\PostgreSQL
  • RedBeanPHP\QueryWriter\SQLiteT
  • RedBeanPHP\R
  • RedBeanPHP\Repository
  • RedBeanPHP\Repository\Fluid
  • RedBeanPHP\Repository\Frozen
  • RedBeanPHP\SimpleModel
  • RedBeanPHP\SimpleModelHelper
  • RedBeanPHP\TagManager
  • RedBeanPHP\ToolBox
  • RedBeanPHP\Util\ArrayTool
  • RedBeanPHP\Util\DispenseHelper
  • RedBeanPHP\Util\Dump
  • RedBeanPHP\Util\MultiLoader
  • RedBeanPHP\Util\Transaction

Interfaces

  • RedBeanPHP\Adapter
  • RedBeanPHP\BeanHelper
  • RedBeanPHP\Cursor
  • RedBeanPHP\Driver
  • RedBeanPHP\Logger
  • RedBeanPHP\Observer
  • RedBeanPHP\Plugin
  • RedBeanPHP\QueryWriter

Exceptions

  • RedBeanPHP\RedException
  • RedBeanPHP\RedException\SQL

Functions

  • array_flatten
  • dmp
  • EID
  • genslots
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace RedBeanPHP\RedException;
 4: 
 5: use RedBeanPHP\RedException as RedException;
 6: 
 7: /**
 8:  * SQL Exception.
 9:  * Represents a generic database exception independent of the underlying driver.
10:  *
11:  * @file       RedBeanPHP/RedException/SQL.php
12:  * @author     Gabor de Mooij and the RedBeanPHP Community
13:  * @license    BSD/GPLv2
14:  *
15:  * @copyright
16:  * (c) copyright G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
17:  * This source file is subject to the BSD/GPLv2 License that is bundled
18:  * with this source code in the file license.txt.
19:  */
20: class SQL extends RedException
21: {
22:     /**
23:      * @var string
24:      */
25:     private $sqlState;
26: 
27:     /**
28:      * Returns an ANSI-92 compliant SQL state.
29:      *
30:      * @return string
31:      */
32:     public function getSQLState()
33:     {
34:         return $this->sqlState;
35:     }
36: 
37:     /**
38:      * Returns the raw SQL STATE, possibly compliant with
39:      * ANSI SQL error codes - but this depends on database driver.
40:      *
41:      * @param string $sqlState SQL state error code
42:      *
43:      * @return void
44:      */
45:     public function setSQLState( $sqlState )
46:     {
47:         $this->sqlState = $sqlState;
48:     }
49: 
50:     /**
51:      * To String prints both code and SQL state.
52:      *
53:      * @return string
54:      */
55:     public function __toString()
56:     {
57:         return '[' . $this->getSQLState() . '] - ' . $this->getMessage()."\n".
58:                 'trace: ' . $this->getTraceAsString();
59:     }
60: }
61: 
API documentation generated by ApiGen