TYPO3 API  SVNRelease
Public Member Functions | Public Attributes | Private Member Functions
tx_dbal_sqlengine Class Reference
Inheritance diagram for tx_dbal_sqlengine:
Inheritance graph
[legend]
Collaboration diagram for tx_dbal_sqlengine:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 init ($config, $pObj)
 resetStatusVars ()
 exec_INSERTquery ($table, $fields_values)
 exec_UPDATEquery ($table, $where, $fields_values)
 exec_DELETEquery ($table, $where)
 exec_SELECTquery ($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit)
 sql_query ($query)
 sql_error ()
 sql_insert_id ()
 sql_affected_rows ()
 quoteStr ($str)
 admin_get_tables ()
 admin_get_fields ($tableName)
 admin_get_keys ($tableName)
 admin_query ($query)
 readDataSource ($table)
 saveDataSource ($table)
 selectFromData ($table, $where)
 select_evalSingle ($table, $config, &$itemKeys)
 getResultSet ($keys, $table, $fieldList)
 debug_printResultSet ($array)

Public Attributes

 $data = array()
 $errorStatus = ''
 $lastInsertedId = 0
 $lastAffectedRows = 0

Private Member Functions

 processAccordingToConfig (&$value, $fInfo)

Detailed Description

Definition at line 100 of file class.tx_dbal_sqlengine.php.


Member Function Documentation

tx_dbal_sqlengine::admin_get_fields ( tableName)

(DUMMY) Returns information about each field in the $table

Parameters:
stringTable name
Returns:
array Field information in an associative array with fieldname => field row

Reimplemented in tx_dbal_handler_rawmysql, tx_dbal_handler_xmldb, and tx_dbal_handler_openoffice.

Definition at line 482 of file class.tx_dbal_sqlengine.php.

Referenced by exec_INSERTquery(), and exec_UPDATEquery().

tx_dbal_sqlengine::admin_get_keys ( tableName)

(DUMMY) Returns information about each index key in the $table

Parameters:
stringTable name
Returns:
array Key information in a numeric array

Reimplemented in tx_dbal_handler_xmldb, tx_dbal_handler_rawmysql, and tx_dbal_handler_openoffice.

Definition at line 493 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::admin_get_tables ( )

(DUMMY) Returns the list of tables from the database

Returns:
array Tables in an array (tablename is in both key and value)
Todo:
Should return table details in value! see t3lib_db::admin_get_tables()

Reimplemented in tx_dbal_handler_rawmysql, tx_dbal_handler_xmldb, and tx_dbal_handler_openoffice.

Definition at line 471 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::admin_query ( query)

(DUMMY) mysql() wrapper function, used by the Install Tool and EM for all queries regarding management of the database!

Parameters:
stringQuery to execute
Returns:
pointer Result pointer

Reimplemented in tx_dbal_handler_xmldb, tx_dbal_handler_rawmysql, and tx_dbal_handler_openoffice.

Definition at line 504 of file class.tx_dbal_sqlengine.php.

References $query, and sql_query().

tx_dbal_sqlengine::debug_printResultSet ( array)

Returns the result set (in array) as HTML table. For debugging.

Parameters:
arrayResult set array (array of rows)
Returns:
string HTML table

Definition at line 741 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::exec_DELETEquery ( table,
where 
)

Execute DELETE query

Parameters:
stringTable to delete from
stringWHERE clause
Returns:
boolean TRUE on success and FALSE on failure (error is set internally)

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 320 of file class.tx_dbal_sqlengine.php.

References t3lib_sqlparser\parseWhereClause(), readDataSource(), resetStatusVars(), saveDataSource(), and selectFromData().

tx_dbal_sqlengine::exec_INSERTquery ( table,
fields_values 
)

Execute an INSERT query

Parameters:
stringTable name
arrayField values as key=>value pairs.
Returns:
boolean TRUE on success and FALSE on failure (error is set internally)

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 193 of file class.tx_dbal_sqlengine.php.

References admin_get_fields(), processAccordingToConfig(), readDataSource(), resetStatusVars(), and saveDataSource().

tx_dbal_sqlengine::exec_SELECTquery ( select_fields,
from_table,
where_clause,
groupBy,
orderBy,
limit 
)

Execute SELECT query

Parameters:
stringList of fields to select from the table. This is what comes right after "SELECT ...". Required value.
stringTable(s) from which to select. This is what comes right after "FROM ...". Required value.
stringOptional additional WHERE clauses put in the end of the query. NOTICE: You must escape values in this argument with $this->fullQuoteStr() yourself! DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
stringOptional GROUP BY field(s), if none, supply blank string.
stringOptional ORDER BY field(s), if none, supply blank string.
stringOptional LIMIT value ([begin,]max), if none, supply blank string.
Returns:
object Returns result object, but if errors, returns false

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 371 of file class.tx_dbal_sqlengine.php.

References getResultSet(), t3lib_div\makeInstance(), t3lib_sqlparser\parseFromTables(), t3lib_sqlparser\parseWhereClause(), readDataSource(), resetStatusVars(), and selectFromData().

tx_dbal_sqlengine::exec_UPDATEquery ( table,
where,
fields_values 
)

Execute UPDATE query on table

Parameters:
stringTable name
stringWHERE clause
arrayField values as key=>value pairs.
Returns:
boolean TRUE on success and FALSE on failure (error is set internally)

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 261 of file class.tx_dbal_sqlengine.php.

References admin_get_fields(), t3lib_sqlparser\parseWhereClause(), processAccordingToConfig(), readDataSource(), resetStatusVars(), saveDataSource(), and selectFromData().

tx_dbal_sqlengine::getResultSet ( keys,
table,
fieldList 
)

Returning result set based on result keys, table and field list

Parameters:
arrayResult keys
stringTablename
stringFieldlist (commaseparated)
Returns:
array Result array with "rows"

Definition at line 711 of file class.tx_dbal_sqlengine.php.

References t3lib_div\trimExplode().

Referenced by exec_SELECTquery().

tx_dbal_sqlengine::init ( config,
pObj 
)

Dummy function for initializing SQL handler. Create you own in derived classes.

Parameters:
arrayConfiguration array from handler
objectParent object
Returns:
void

Reimplemented in tx_dbal_handler_xmldb, and tx_dbal_handler_openoffice.

Definition at line 119 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::processAccordingToConfig ( &$  value,
fInfo 
) [private]

Processing of update/insert values based on field type.

The input value is typecast and trimmed/shortened according to the field type and the configuration options from the $fInfo parameter.

Parameters:
mixed$valueThe input value to process
array$fInfoField configuration data
Returns:
mixed The processed input value

Definition at line 143 of file class.tx_dbal_sqlengine.php.

References $value, t3lib_div\intInRange(), and t3lib_sqlparser\parseFieldDef().

Referenced by exec_INSERTquery(), and exec_UPDATEquery().

tx_dbal_sqlengine::quoteStr ( str)

Quoting strings for insertion in SQL queries

Parameters:
stringInput String
Returns:
string String, with quotes escaped

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 453 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::readDataSource ( table)

Dummy function for setting table data. Create your own. NOTICE: Handler to "table-locking" needs to be made probably!

Parameters:
stringTable name
Returns:
void
Todo:
Table locking tools?

Reimplemented in tx_dbal_handler_xmldb, and tx_dbal_handler_openoffice.

Definition at line 523 of file class.tx_dbal_sqlengine.php.

Referenced by exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), and exec_UPDATEquery().

tx_dbal_sqlengine::resetStatusVars ( )

Reset SQL engine status variables (insert id, affected rows, error status)

Returns:
void

Definition at line 127 of file class.tx_dbal_sqlengine.php.

Referenced by exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), and exec_UPDATEquery().

tx_dbal_sqlengine::saveDataSource ( table)

Dummy function for setting table data. Create your own. NOTICE: Handler to "table-locking" needs to be made probably!

Parameters:
stringTable name
Returns:
void
Todo:
Table locking tools?

Reimplemented in tx_dbal_handler_xmldb, and tx_dbal_handler_openoffice.

Definition at line 535 of file class.tx_dbal_sqlengine.php.

References debug().

Referenced by exec_DELETEquery(), exec_INSERTquery(), and exec_UPDATEquery().

tx_dbal_sqlengine::select_evalSingle ( table,
config,
&$  itemKeys 
)

Evalutaion of a WHERE-clause-array. Yet EXPERIMENTAL

Parameters:
stringTablename
arrayWHERE-configuration array
arrayData array to work on.
Returns:
void Data array passed by reference
See also:
selectFromData()

Definition at line 592 of file class.tx_dbal_sqlengine.php.

References selectFromData().

Referenced by selectFromData().

tx_dbal_sqlengine::selectFromData ( table,
where 
)

PHP simulation of SQL "SELECT" Yet EXPERIMENTAL!

Parameters:
stringTable name
arrayWhere clause parsed into array
Returns:
array Array of keys pointing to result rows in $this->data[$table]

Definition at line 554 of file class.tx_dbal_sqlengine.php.

References select_evalSingle().

Referenced by exec_DELETEquery(), exec_SELECTquery(), exec_UPDATEquery(), and select_evalSingle().

tx_dbal_sqlengine::sql_affected_rows ( )

Returns affected rows (of UPDATE and DELETE queries)

Returns:
integer Last amount of affected rows.

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 443 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::sql_error ( )

Returns most recent error

Returns:
string Error message, if any

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 425 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::sql_insert_id ( )

Returns most recently create unique ID (of INSERT queries)

Returns:
integer Last unique id created.

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 434 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::sql_query ( query)

Performs an SQL query on the "database"

Parameters:
stringQuery to execute
Returns:
object Result object or false if error

Reimplemented in tx_dbal_handler_rawmysql.

Definition at line 414 of file class.tx_dbal_sqlengine.php.

References $res, and t3lib_div\makeInstance().

Referenced by admin_query().


Member Data Documentation

tx_dbal_sqlengine::$data = array()

Definition at line 103 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::$errorStatus = ''

Definition at line 107 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::$lastAffectedRows = 0

Definition at line 109 of file class.tx_dbal_sqlengine.php.

tx_dbal_sqlengine::$lastInsertedId = 0

Definition at line 108 of file class.tx_dbal_sqlengine.php.


The documentation for this class was generated from the following file: