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_insert

Source Location: /tNG3/tNG_insert.class.php

Class Overview

tNG
   |
   --tNG_fields
      |
      --tNG_insert

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


Author(s):

Methods


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



Tags:

access:  public


[ Top ]


Class Methods


constructor tNG_insert [line 18]

tNG_insert tNG_insert( 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 121]

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 doTransaction [line 29]

void doTransaction( )

Overwrites tNG method in order to register some triggers specific to Register Transaction



Tags:

access:  protected


Overrides tNG::doTransaction() (executing the transaction (triggers, prepare SQL))

[ Top ]

method getLocalRecordset [line 96]

object resource getLocalRecordset( )

Get the local recordset associated to this transaction



Tags:

return:  Recordset resource
access:  protected


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

[ Top ]

method postExecuteSql [line 135]

void postExecuteSql( )

This function is called once the transaction SQL was actually executed And only if the execution was succesffully. On insert, it sets the primary key value if it is not set.



Tags:

access:  protected


Overrides tNG::postExecuteSql() (This function is called once the transaction SQL was actually executed)

[ Top ]

method prepareSQL [line 54]

void prepareSQL( )

Prepares the insert SQL query to be executed



Tags:

access:  protected


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

[ Top ]

method wereValuesSubmitted [line 150]

boolean wereValuesSubmitted( )

if at least one value was submited return true;



Tags:

access:  protected


[ Top ]



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