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_CSVImport

Source Location: /tNG3/tNG_CSVImport.class.php

Class Overview

tNG
   |
   --tNG_fields
      |
      --tNG_multiple
         |
         --tNG_import
            |
            --tNG_CSVImport

This class is the "CSV" implementation of the tNG_import class.


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: tNG_import

tNG_import::tNG_import()
Constructor. Sets the connection, the database name and other default values.
tNG_import::addColumn()
Adds a column to the transaction Calls the parent addColumn method then sets the default value.
tNG_import::getErrorMsg()
Gets the error message Adds the import specific messages, then calls the parent getErrorMsg method.
tNG_import::prepareData()
Abstract method; must be implemented by the inherited classes;
tNG_import::prepareSQL()
Executes all sub-transactions
tNG_import::saveData()
No data needs to be saved on insert.
tNG_import::setHandleDuplicates()
Sets the way duplicates are handled
tNG_import::setSource()
Sets the source of the import data
tNG_import::setUniqueKey()
Sets the unique key column

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 "CSV" implementation of the tNG_import class.



Tags:

access:  public


[ Top ]


Class Methods


constructor tNG_CSVImport [line 31]

tNG_CSVImport tNG_CSVImport( object KT_Connection &$connection)

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

Also sets the import type and import variables reference.




Tags:

access:  public


Parameters:

object KT_Connection   &$connection   the connection object

[ Top ]

method getHints [line 139]

string getHints( )

Generates sample and hints for the current CSV import transaction



Tags:

access:  public


[ Top ]

method prepareData [line 102]

object tNG_Error &prepareData( )

Set the headers and data structures associated to this transaction



Tags:

return:  or null if no error occured
access:  protected


Overrides tNG_import::prepareData() (Abstract method; must be implemented by the inherited classes;)

[ Top ]

method setCSVUniqueKey [line 93]

void setCSVUniqueKey( string $CSVuniqueKey)

Sets the unique key column for the CSV import Calls the parent setUniqueKey method.



Tags:

access:  public


Parameters:

string   $CSVuniqueKey   The name of the unique key column

[ Top ]

method setDelimiter [line 70]

void setDelimiter( string $delimiter)

Sets the delimiter of CSV data



Tags:

access:  public


Parameters:

string   $delimiter   the delimiter

[ Top ]

method setEnclosure [line 83]

void setEnclosure( string $enclosure)

Sets the enclosure of CSV data



Tags:

access:  public


Parameters:

string   $enclosure   the enclosure

[ Top ]

method setHeader [line 58]

void setHeader( boolean $hasHeader)

Sets the hasHeader property of the import transaction



Tags:

access:  public


Parameters:

boolean   $hasHeader   true if the CSV file contains headers

[ Top ]

method setSource [line 45]

void setSource( string $type, string $reference)

Sets the source of the CSV data Calls the parent setSource method and also registers an upload file STARTER trigger.



Tags:

access:  public


Overrides tNG_import::setSource() (Sets the source of the import data)

Parameters:

string   $type   The type of the source (FILES only)
string   $reference   The submitted variable name (if type=FILES and reference=test, value=$_FILES['test'])

[ Top ]



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