propel-util
[ class tree: propel-util ] [ index: propel-util ] [ all elements ]

Class: PropelPDO

Source Location: /util/PropelPDO.php

Class Overview

PDO
   |
   --PropelPDO

PDO connection subclass that provides some enhanced functionality needed by Propel.


Author(s):

Variables

Methods


Inherited Constants

Class: PDO (Internal Class)

ATTR_AUTOCOMMIT = 0
ATTR_CASE = 8
ATTR_CLIENT_VERSION = 5
ATTR_CONNECTION_STATUS = 7
ATTR_CURSOR = 10
ATTR_CURSOR_NAME = 9
ATTR_DEFAULT_FETCH_MODE = 19
ATTR_DRIVER_NAME = 16
ATTR_EMULATE_PREPARES = 20
ATTR_ERRMODE = 3
ATTR_FETCH_CATALOG_NAMES = 15
ATTR_FETCH_TABLE_NAMES = 14
ATTR_MAX_COLUMN_LEN = 18
ATTR_ORACLE_NULLS = 11
ATTR_PERSISTENT = 12
ATTR_PREFETCH = 1
ATTR_SERVER_INFO = 6
ATTR_SERVER_VERSION = 4
ATTR_STATEMENT_CLASS = 13
ATTR_STRINGIFY_FETCHES = 17
ATTR_TIMEOUT = 2
CASE_LOWER = 2
CASE_NATURAL = 0
CASE_UPPER = 1
CURSOR_FWDONLY = 0
CURSOR_SCROLL = 1
ERRMODE_EXCEPTION = 2
ERRMODE_SILENT = 0
ERRMODE_WARNING = 1
ERR_NONE = '00000'
FETCH_ASSOC = 2
FETCH_BOTH = 4
FETCH_BOUND = 6
FETCH_CLASS = 8
FETCH_CLASSTYPE = 262144
FETCH_COLUMN = 7
FETCH_FUNC = 10
FETCH_GROUP = 65536
FETCH_INTO = 9
FETCH_KEY_PAIR = 12
FETCH_LAZY = 1
FETCH_NAMED = 11
FETCH_NUM = 3
FETCH_OBJ = 5
FETCH_ORI_ABS = 4
FETCH_ORI_FIRST = 2
FETCH_ORI_LAST = 3
FETCH_ORI_NEXT = 0
FETCH_ORI_PRIOR = 1
FETCH_ORI_REL = 5
FETCH_PROPS_LATE = 1048576
FETCH_SERIALIZE = 524288
FETCH_UNIQUE = 196608
NULL_EMPTY_STRING = 1
NULL_NATURAL = 0
NULL_TO_STRING = 2
PARAM_BOOL = 5
PARAM_EVT_ALLOC = 0
PARAM_EVT_EXEC_POST = 3
PARAM_EVT_EXEC_PRE = 2
PARAM_EVT_FETCH_POST = 5
PARAM_EVT_FETCH_PRE = 4
PARAM_EVT_FREE = 1
PARAM_EVT_NORMALIZE = 6
PARAM_INPUT_OUTPUT = -2147483648
PARAM_INT = 1
PARAM_LOB = 3
PARAM_NULL = 0
PARAM_STMT = 4
PARAM_STR = 2
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT = 1000

Inherited Methods

Class: PDO (Internal Class)

constructor __construct ( )
beginTransaction ( )
commit ( )
errorCode ( )
errorInfo ( )
exec ( )
getAttribute ( )
getAvailableDrivers ( )
lastInsertId ( )
prepare ( )
query ( )
quote ( )
rollBack ( )
setAttribute ( )
__sleep ( )
__wakeup ( )

Class Details

[line 41]
PDO connection subclass that provides some enhanced functionality needed by Propel.

This class was designed to work around the limitation in PDO where attempting to begin a transaction when one has already been begun will trigger a PDOException. Propel relies on the ability to create nested transactions, even if the underlying layer simply ignores these (because it doesn't support nested transactions).

The changes that this class makes to the underlying API include the addition of the getNestedTransactionDepth() and isInTransaction() and the fact that beginTransaction() will no longer throw a PDOException (or trigger an error) if a transaction is already in-progress.




Tags:

author:  Hans Lellelid <hans@xmpl.org>
author:  Cameron Brunner <cameron.brunner@gmail.com>
since:  2006-09-22


[ Top ]


Class Variables

$nestedTransactionCount =  0

[line 47]

The current transaction depth.



Tags:

access:  protected

Type:   int


[ Top ]



Class Methods


method beginTransaction [line 97]

void beginTransaction( )

Overrides PDO::beginTransaction() to prevent errors due to already-in-progress transaction.



Tags:

access:  public


Overrides PDO::beginTransaction ( ) (parent method not documented)

[ Top ]

method commit [line 112]

void commit( )

Overrides PDO::commit() to only commit the transaction if we are in the outermost transaction nesting level.



Tags:

access:  public


Overrides PDO::commit ( ) (parent method not documented)

[ Top ]

method decrementNestedTransactionCount [line 70]

void decrementNestedTransactionCount( )

Decrements the current transaction depth by one.



Tags:

access:  protected


[ Top ]

method getNestedTransactionCount [line 53]

int getNestedTransactionCount( )

Gets the current transaction depth.



Tags:

access:  public


[ Top ]

method incrementNestedTransactionCount [line 78]

void incrementNestedTransactionCount( )

Increments the current transaction depth by one.



Tags:

access:  protected


[ Top ]

method isInTransaction [line 89]

boolean isInTransaction( )

Is this PDO connection currently in-transaction? This is equivalent to asking whether the current nested transaction count is greater than 0.



Tags:

access:  public


[ Top ]

method prepare [line 145]

void prepare( $sql, [ $driver_options = array()])

Overrides PDO::prepare() to add logging.



Tags:

access:  public


Overrides PDO::prepare ( ) (parent method not documented)

Parameters:

   $sql  
   $driver_options  

[ Top ]

method rollback [line 129]

void rollback( )

Overrides PDO::rollback() to only rollback the transaction if we are in the outermost transaction nesting level.



Tags:

access:  public


Overrides PDO::rollBack ( ) (parent method not documented)

[ Top ]

method setNestedTransactionCount [line 62]

void setNestedTransactionCount( int $v)

Set the current transaction depth.



Tags:

access:  protected


Parameters:

int   $v   The new depth.

[ Top ]


Documentation generated on Thu, 22 Nov 2007 03:33:54 +0000 by phpDocumentor 1.4.0