Transaction Engine 3 Application Programming Interface
[ class tree: Transaction Engine 3 Application Programming Interface ] [ index: Transaction Engine 3 Application Programming Interface ] [ all elements ]

Class: tNG_multiple

Source Location: /tNG3/tNG_multiple.class.php

Class Overview

tNG
   |
   --tNG_fields
      |
      --tNG_multiple

This class adds a "multiple" layer to the tNG_fields class.


Author(s):

Variables

Methods


Child classes:

tNG_import
This class is the "import" implementation of the tNG_multiple class.
tNG_multipleDelete
This class is the "delete" implementation of the tNG_multiple class.
tNG_multipleInsert
This class is the "insert" implementation of the tNG_multiple class.
tNG_multipleUpdate
This class is the "update" implementation of the tNG_multiple class.

Inherited Variables

Inherited Methods

Class: tNG_fields

tNG_fields::addColumn()
Adds a column to the transaction
tNG_fields::afterUpdateField()
Updates a field after the actual transaction was executed
tNG_fields::compileColumnsValues()
Sets for each column the value correspondeing to the reference/method
tNG_fields::evaluateNumeric()
Evaluates a numeric expression
tNG_fields::executeTransaction()
Evaluates the columns values then executes the Transaction
tNG_fields::getColumnReference()
Gets the reference of a column
tNG_fields::getColumnType()
Gets the type of a column
tNG_fields::getColumnValue()
Gets the value of a column
tNG_fields::getFakeRecordset()
Creates a fake recordset from the given columns associative array This function is called on error or for the insert default values.
tNG_fields::getFakeRsArr()
Creates a fake recordset array from the current $columns
tNG_fields::getFieldError()
Gets the error message for a specific field, if it exists.
tNG_fields::getLocalRecordset()
Get the local recordset associated to this transaction
tNG_fields::getPrimaryKey()
Gets the primary key column
tNG_fields::getPrimaryKeyValue()
Gets the primary key value
tNG_fields::getRecordset()
Get the recordset associated to this transaction
tNG_fields::getSavedValue()
Gets the value saved for the given column name
tNG_fields::getTable()
Getter for the transaction SQL table
tNG_fields::parseSQLError()
Parses the SQL error Calls the parent function then sets the error to a specific column if possible.
tNG_fields::prepareSQL()
Prepares the SQL query to be executed
tNG_fields::saveData()
Retrieve and store the saved values from database;
tNG_fields::setColumnValue()
Sets a value for a given column
tNG_fields::setPrimaryKey()
Sets the primary key and its details
tNG_fields::setRawColumnValue()
Sets a value for a column directly
tNG_fields::setTable()
Setter for the transaction SQL table

Class: tNG

tNG::tNG()
Constructor. Sets the connection.
tNG::doTransaction()
executing the transaction (triggers, prepare SQL)
tNG::executeTransaction()
Executes the Transaction Tests the STARTER triggers, executes the BEFORE triggers, the transaction SQL, the AFTER triggers and the END triggers. If error occurs, it executes the ERROR triggers and exits.
tNG::executeTriggers()
Executes the registered triggers that matches the specified type
tNG::exportsRecordset()
Getter for the exportsRecordset property
tNG::getDispatcher()
Gets the transaction dispatcher
tNG::getError()
Getter for the transaction error object
tNG::getErrorMsg()
Gets the error message
tNG::getTransactionType()
Gets the transaction type
tNG::isStarted()
Gets the started property
tNG::parseSQLError()
Parses the SQL error
tNG::postExecuteSql()
This function is called once the transaction SQL was actually executed
tNG::prepareSQL()
Prepares the SQL query to be executed
tNG::registerTrigger()
Register the trigger to transaction;
tNG::rollBackTransaction()
Executes the error triggers and set the error object;
tNG::setDispatcher()
Set dispatcher object for the transaction.
tNG::setError()
Setter for the transaction error object
tNG::setSQL()
Sets the transaction SQL statement
tNG::setStarted()
Sets the started property (the starter triggers are the ones that call this function)

Class Details

[line 11]
This class adds a "multiple" layer to the tNG_fields class.

To be used for multiple insert/update and delete, this class instantiates a dynamic number of "simple" insert/update/delete transactions and then executes them in a loop.




Tags:

abstract:  


[ Top ]


Class Variables

$multTNGs =

[line 16]

List of transactions to be executed in the loop


Type:   array


[ Top ]

$multTriggers =

[line 22]

List of triggers that are to be linked to the $multTNGs


Type:   array


[ Top ]

$noSuccess =

[line 28]

Number of transactions that executed successfully


Type:   integer


[ Top ]



Class Methods


method getErrorMsg [line 125]

string getErrorMsg( )

Gets the error message



Tags:

return:  transaction error message (formatted)
access:  public


Overridden in child classes as:

tNG_import::getErrorMsg()
Gets the error message Adds the import specific messages, then calls the parent getErrorMsg method.

Overrides tNG::getErrorMsg() (Gets the error message)

[ Top ]

method getFieldError [line 147]

string getFieldError( string $fName, integer $cnt)

Gets the error message for a specific field, if it exists.



Tags:

return:  error message
access:  public


Overrides tNG_fields::getFieldError() (Gets the error message for a specific field, if it exists.)

Parameters:

string   $fName   the field name
integer   $cnt   the transaction number

[ Top ]

method getLocalRecordset [line 232]

nothing getLocalRecordset( )

Abstract method; must be implemented by the inherited classes;



Overridden in child classes as:

tNG_multipleDelete::getLocalRecordset()
No recordset is created when multiple delete is executed; thus the calling of this method set an error;
tNG_multipleInsert::getLocalRecordset()
Get the local recordset associated to this transaction
tNG_multipleUpdate::getLocalRecordset()
Get the local recordset associated to this transaction

Overrides tNG_fields::getLocalRecordset() (Get the local recordset associated to this transaction)

[ Top ]

method getRecordset [line 196]

object resource getRecordset( )

Get the recordset associated to this transaction

The fake recordset on error or the local recordset




Tags:

return:  Recordset resource


Overrides tNG_fields::getRecordset() (Get the recordset associated to this transaction)

[ Top ]

method getSavedValue [line 223]

void getSavedValue( mixed $colName)

Wrapper for getSavedValue method of the executed transactions;



Overrides tNG_fields::getSavedValue() (Gets the value saved for the given column name)

[ Top ]

method registerConditionalTrigger [line 79]

boolean registerConditionalTrigger( string $condition, string $triggerType, string $callBackFunction, integer $priority)

Register a trigger to the current transaction Or to the multiple transactions. The STARTER and the END triggers are registered to self, and the other triggers are sent to the multiple transactions.



Tags:

return:  true if the trigger was registered, false if there is an error (unknown trigger type)
access:  public


Parameters:

string   $condition  
string   $triggerType   the trigger type (STARTER, AFTER, BEFORE, ERROR or END)
string   $callBackFunction   the function name to callback when the trigger is executed
integer   $priority   the trigger priority

[ Top ]

method registerTrigger [line 47]

boolean registerTrigger( string $triggerType, mixed $callBackFunction, integer $priority, string $triggerName)

Register a trigger to the current transaction Or to the multiple transactions. The STARTER and the END triggers are registered to self, and the other triggers are sent to the multiple transactions.



Tags:

return:  true if the trigger was registered, false if there is an error (unknown trigger type)
access:  public


Overrides tNG::registerTrigger() (Register the trigger to transaction;)

Parameters:

string   $triggerType   the trigger type (STARTER, AFTER, BEFORE, ERROR or END)
string   $triggerName   the function name to callback when the trigger is executed
integer   $priority   the trigger priority

[ Top ]



Documentation generated on Tue, 6 Dec 2005 15:11:50 +0200 by phpDocumentor 1.3.0RC3