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_multipleInsert

Source Location: /tNG3/tNG_multipleInsert.class.php

Class Overview

tNG
   |
   --tNG_fields
      |
      --tNG_multiple
         |
         --tNG_multipleInsert

This class is the "insert" implementation of the tNG_multiple class.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: tNG_multiple

tNG_multiple::getErrorMsg()
Gets the error message
tNG_multiple::getFieldError()
Gets the error message for a specific field, if it exists.
tNG_multiple::getLocalRecordset()
Abstract method; must be implemented by the inherited classes;
tNG_multiple::getRecordset()
Get the recordset associated to this transaction
tNG_multiple::getSavedValue()
Wrapper for getSavedValue method of the executed transactions;
tNG_multiple::registerConditionalTrigger()
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.
tNG_multiple::registerTrigger()
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.

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 10]
This class is the "insert" implementation of the tNG_multiple class.



Tags:

access:  public


[ Top ]


Class Variables

$executeSubSets =

[line 22]

if is false will check set ther error on each transaction and will reset the Number of transactions executed successfully



Tags:

access:  public

Type:   mixed


[ Top ]

$insertElements =

[line 16]

number of the successful inserts;



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor tNG_multipleInsert [line 30]

tNG_multipleInsert tNG_multipleInsert( object KT_Connection &$connection)

Constructor. Sets the connection, the database name and other default values.

Also sets the transaction type.




Tags:

access:  public


Parameters:

object KT_Connection   &$connection   the connection object

[ Top ]

method addColumn [line 175]

void addColumn( string $colName, string $type, string $method, string $reference, [string $defaultValue = ''])

Adds a column to the transaction Calls the parent addColumn method then sets the default value.



Tags:

access:  public


Overrides tNG_fields::addColumn() (Adds a column to the transaction)

Parameters:

string   $colName   The column name
string   $type   The column type (NUMERYC_TYPE, STRING_TYPE, etc)
string   $method   The request method (GET, POST, FILE, COOKIE, SESSION)
string   $reference   The submitted variable name (if method=GET and reference=test, value=$_GET['test'])
string   $defaultValue   The default value for the current column

[ Top ]

method getLocalRecordset [line 145]

object resource getLocalRecordset( )

Get the local recordset associated to this transaction



Tags:

return:  Recordset resource
access:  protected


Overrides tNG_multiple::getLocalRecordset() (Abstract method; must be implemented by the inherited classes;)

[ Top ]

method prepareSQL [line 57]

void prepareSQL( )

Executes all sub-transactions



Tags:

access:  protected


Overrides tNG_fields::prepareSQL() (Prepares the SQL query to be executed)

[ Top ]

method saveData [line 190]

nothing saveData( none 0)

No data needs to be saved on insert.



Tags:

access:  public


Overrides tNG_fields::saveData() (Retrieve and store the saved values from database;)

Parameters:

none   0  

[ Top ]

method setInsertElements [line 43]

nothing setInsertElements( string $method, string $reference)

setter. set the number of inserts will be made;



Parameters:

string   $method  
string   $reference  

[ Top ]



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