Functions | Variables

InternalCAS_PGTStorageDb

Functions

 CAS_PGTStorage_Db::getPdo ()
 CAS_PGTStorage_Db::getTable ()
 CAS_PGTStorage_Db::getStorageType ()
 CAS_PGTStorage_Db::getStorageInfo ()
 CAS_PGTStorage_Db::__construct ($cas_parent, $dsn_or_pdo, $username='', $password='', $table='', $driver_options=null)
 CAS_PGTStorage_Db::init ()
 CAS_PGTStorage_Db::setErrorMode ()
 CAS_PGTStorage_Db::resetErrorMode ()
 CAS_PGTStorage_Db::_createTableSql ()
 CAS_PGTStorage_Db::_storePgtSql ()
 CAS_PGTStorage_Db::_retrievePgtSql ()
 CAS_PGTStorage_Db::_deletePgtSql ()
 CAS_PGTStorage_Db::createTable ()
 CAS_PGTStorage_Db::write ($pgt, $pgt_iou)
 CAS_PGTStorage_Db::read ($pgt_iou)

Variables

 CAS_PGTStorage_Db::$_pdo
 CAS_PGTStorage_Db::$_dsn
 CAS_PGTStorage_Db::$_username
 CAS_PGTStorage_Db::$_password
 CAS_PGTStorage_Db::$_table_options
 CAS_PGTStorage_Db::$_table
 CAS_PGTStorage_Db::$_errMode

Function Documentation

CAS_PGTStorage_Db::__construct ( cas_parent,
dsn_or_pdo,
username = '',
password = '',
table = '',
driver_options = null 
) [inherited]

The class constructor.

Parameters:
$cas_parent the CAS_Client instance that creates the object.
$dsn_or_pdo a dsn string to use for creating a PDO object or a PDO object
$username the username to use when connecting to the database
$password the password to use when connecting to the database
$table the table to use for storing and retrieving PGT's
$driver_options any driver options to use when connecting to the database

Definition at line 132 of file Db.php.

References phpCAS::traceBegin(), and phpCAS::traceEnd().

CAS_PGTStorage_Db::_createTableSql (  )  [protected, inherited]

This method returns the query used to create a pgt storage table

Returns:
the create table SQL, no bind params in query

Definition at line 231 of file Db.php.

References CAS_PGTStorage_Db::getTable().

CAS_PGTStorage_Db::_deletePgtSql (  )  [protected, inherited]

This method returns the query used to delete a pgt.

Returns:
the delete PGT SQL, :pgt_iou is the only bind param contained in the query

Definition at line 261 of file Db.php.

References CAS_PGTStorage_Db::getTable().

Referenced by CAS_PGTStorage_Db::read().

CAS_PGTStorage_Db::_retrievePgtSql (  )  [protected, inherited]

This method returns the query used to retrieve a pgt. the first column of the first row should contain the pgt

Returns:
the retrieve PGT SQL, :pgt_iou is the only bind param contained in the query

Definition at line 251 of file Db.php.

References CAS_PGTStorage_Db::getTable().

Referenced by CAS_PGTStorage_Db::read().

CAS_PGTStorage_Db::_storePgtSql (  )  [protected, inherited]

This method returns the query used to store a pgt

Returns:
the store PGT SQL, :pgt and :pgt_iou are the bind params contained in the query

Definition at line 241 of file Db.php.

References CAS_PGTStorage_Db::getTable().

Referenced by CAS_PGTStorage_Db::write().

CAS_PGTStorage_Db::createTable (  )  [inherited]

This method creates the database table used to store pgt's and pgtiou's

Definition at line 273 of file Db.php.

References phpCAS::error(), CAS_PGTStorage_Db::getPdo(), CAS_PGTStorage_Db::resetErrorMode(), CAS_PGTStorage_Db::setErrorMode(), phpCAS::traceBegin(), and phpCAS::traceEnd().

CAS_PGTStorage_Db::getPdo (  )  [private, inherited]

This method returns the PDO object to use for database interactions.

Returns:
the PDO object

Definition at line 63 of file Db.php.

Referenced by CAS_PGTStorage_Db::createTable(), CAS_PGTStorage_Db::read(), CAS_PGTStorage_Db::resetErrorMode(), CAS_PGTStorage_Db::setErrorMode(), and CAS_PGTStorage_Db::write().

CAS_PGTStorage_Db::getStorageInfo (  )  [inherited]

This method returns an informational string giving informations on the parameters of the storage.(used for debugging purposes).

Returns:
an informational string.

Reimplemented from CAS_PGTStorage_AbstractStorage.

Definition at line 113 of file Db.php.

CAS_PGTStorage_Db::getStorageType (  )  [inherited]

This method returns an informational string giving the type of storage used by the object (used for debugging purposes).

Returns:
an informational string.

Reimplemented from CAS_PGTStorage_AbstractStorage.

Definition at line 101 of file Db.php.

CAS_PGTStorage_Db::getTable (  )  [private, inherited]

This method returns the table to use when storing/retrieving PGT's

Returns:
the name of the pgt storage table.

Definition at line 86 of file Db.php.

Referenced by CAS_PGTStorage_Db::_createTableSql(), CAS_PGTStorage_Db::_deletePgtSql(), CAS_PGTStorage_Db::_retrievePgtSql(), and CAS_PGTStorage_Db::_storePgtSql().

CAS_PGTStorage_Db::init (  )  [inherited]

This method is used to initialize the storage. Halts on error.

Reimplemented from CAS_PGTStorage_AbstractStorage.

Definition at line 166 of file Db.php.

References phpCAS::error(), CAS_PGTStorage_AbstractStorage::isInitialized(), phpCAS::traceBegin(), and phpCAS::traceEnd().

CAS_PGTStorage_Db::read ( pgt_iou  )  [inherited]

This method reads a PGT corresponding to a PGT Iou and deletes the corresponding db entry.

Parameters:
$pgt_iou the PGT iou
Returns:
the corresponding PGT, or FALSE on error

Reimplemented from CAS_PGTStorage_AbstractStorage.

Definition at line 353 of file Db.php.

References CAS_PGTStorage_Db::_deletePgtSql(), CAS_PGTStorage_Db::_retrievePgtSql(), CAS_PGTStorage_Db::getPdo(), CAS_PGTStorage_Db::resetErrorMode(), CAS_PGTStorage_Db::setErrorMode(), phpCAS::trace(), phpCAS::traceBegin(), and phpCAS::traceEnd().

CAS_PGTStorage_Db::resetErrorMode (  )  [private, inherited]

this method will reset the error mode on the PDO object

Definition at line 212 of file Db.php.

References CAS_PGTStorage_Db::getPdo().

Referenced by CAS_PGTStorage_Db::createTable(), CAS_PGTStorage_Db::read(), and CAS_PGTStorage_Db::write().

CAS_PGTStorage_Db::setErrorMode (  )  [private, inherited]

This method will enable the Exception error mode on the PDO object

Definition at line 201 of file Db.php.

References CAS_PGTStorage_Db::getPdo().

Referenced by CAS_PGTStorage_Db::createTable(), CAS_PGTStorage_Db::read(), and CAS_PGTStorage_Db::write().

CAS_PGTStorage_Db::write ( pgt,
pgt_iou 
) [inherited]

This method stores a PGT and its corresponding PGT Iou in the database. Echoes a warning on error.

Parameters:
$pgt the PGT
$pgt_iou the PGT iou

Reimplemented from CAS_PGTStorage_AbstractStorage.

Definition at line 311 of file Db.php.

References CAS_PGTStorage_Db::_storePgtSql(), phpCAS::error(), CAS_PGTStorage_Db::getPdo(), CAS_PGTStorage_Db::resetErrorMode(), CAS_PGTStorage_Db::setErrorMode(), phpCAS::traceBegin(), and phpCAS::traceEnd().


Variable Documentation

CAS_PGTStorage_Db::$_dsn [private, inherited]

database connection options to use when creating a new PDO object

Definition at line 71 of file Db.php.

CAS_PGTStorage_Db::$_errMode [private, inherited]

attribute that stores the previous error mode for the PDO handle while processing a transaction

Definition at line 196 of file Db.php.

CAS_PGTStorage_Db::$_password [private, inherited]

Definition at line 73 of file Db.php.

CAS_PGTStorage_Db::$_pdo [private, inherited]

the PDO object to use for database interactions

Definition at line 56 of file Db.php.

CAS_PGTStorage_Db::$_table [private, inherited]

the table to use for storing/retrieving pgt's

Definition at line 79 of file Db.php.

CAS_PGTStorage_Db::$_table_options [private, inherited]

Definition at line 74 of file Db.php.

CAS_PGTStorage_Db::$_username [private, inherited]

Definition at line 72 of file Db.php.