method addColumn [line 2641]
void addColumn(
tablename
$tablename, fields
$fields)
|
|
add column(s) to a table
Tags:
Parameters:
method changeTable [line 2349]
bool changeTable(
tablename
$tablename, [sql
$sql = null], [tabopt
$tabopt = null])
|
|
change database table using ADODB dictionary method
Tags:
Parameters:
method createDatabase [line 2942]
bool createDatabase(
dbname
$dbname, [optionsarray
$optionsarray = false])
|
|
create database
Tags:
Parameters:
method createIndex [line 2506]
void createIndex(
idxname
$idxname, tablename
$tablename, flds
$flds, [idxoptarray
$idxoptarray = false])
|
|
create index on table
Tags:
Parameters:
method createTable [line 2298]
bool createTable(
tablename
$tablename, [sql
$sql = null], [tabopt
$tabopt = null])
|
|
create a database table using ADODB dictionary method
Tags:
Parameters:
method decrementObjectFieldByID [line 2037]
The decrementObjectFieldByID(
tablename
$tablename, decfield
$decfield, id
$id, [idfield
$idfield = 'id'], [deccount
$deccount = 1])
|
|
Loop through the array and feed it to DBUtil::insertObject()
Tags:
Parameters:
method deleteObject [line 2089]
The deleteObject(
object The
$object, tablename
$tablename, [where
$where = ''], [idcolumn
$idcolumn = 'id'])
|
|
Generate and execute a delete SQL statement for the given object
Tags:
Parameters:
method deleteObjectByID [line 2071]
The deleteObjectByID(
tablename
$tablename, id
$id, [idcolumn
$idcolumn = 'id'])
|
|
Delete an object by its ID.
Tags:
Parameters:
method deleteObjectsFromKeyArray [line 2181]
void deleteObjectsFromKeyArray(
$keyarray,
$tablename, [
$field = 'id'])
|
|
Parameters:
method deleteWhere [line 2051]
The deleteWhere(
tablename
$tablename, where
$where)
|
|
Delete (an) object(s) via a where clause
Tags:
Parameters:
method dropColumn [line 2681]
void dropColumn(
tablename
$tablename, fields
$fields)
|
|
drop column(s) from a table
Tags:
Parameters:
method dropIndex [line 2568]
void dropIndex(
idxname
$idxname, tablename
$tablename)
|
|
drop index on table
Tags:
Parameters:
method dropTable [line 2460]
bool dropTable(
tablename
$tablename)
|
|
delete database table
Parameters:
method executeSQL [line 56]
mixed executeSQL(
sql
$sql, [limitOffset
$limitOffset = -1], [limitNumRows
$limitNumRows = -1], [sql
$exitOnError = true], [exitOnError
$verbose = true], verbose
5)
|
|
Execute SQL, check for errors and return result. Uses Adodb to generate DB-portable paging code.
Tags:
Parameters:
method generateCategoryFilterWhere [line 803]
The generateCategoryFilterWhere(
tablename
$tablename, where
$where, categoryFilter
$categoryFilter, [returnArray
$returnArray = false])
|
|
Append the approriate category filter where-clause to the given where clause.
Tags:
Parameters:
method getColumnsArray [line 458]
The getColumnsArray(
tablename
$tablename, [columnArray
$columnArray = null])
|
|
return the column array for the given table
Tags:
Parameters:
method getInsertID [line 2205]
void getInsertID(
$tablename, [
$field = 'id'], [
$exitOnError = true], [
$verbose = true])
|
|
Parameters:
method getLimitedTablename [line 2969]
bool getLimitedTablename(
$tablename
$tablename, [$dbdriver
$dbdriver = ''])
|
|
limit the table name if necessary and prepend the prefix
When using Oracle the object name may not be longer than 30 chars. Now ADODB uses TRIGGERS and SEQUENCEs to emulate the AUTOINCREMENT which eats up to 9 chars (TRIG_SEQ_<prefix>_<tablename>) so we have to limit the length of the table name to 30 - 9 - length(prefix) - separator. We use this function as a central point to shorten table name (there might be restrictions in ' other RDBMS too). If the resulting tablename is empty we will show an error. In this case the prefix is too long.
Tags:
Parameters:
method getTableConstraints [line 2268]
void getTableConstraints(
$tablename)
|
|
get the table constraints from the pntables array
Tags:
Parameters:
method getTableDefinition [line 2229]
void getTableDefinition(
$tablename)
|
|
get the table definition from the pntables array
Parameters:
method incrementObjectFieldByID [line 2009]
The incrementObjectFieldByID(
tablename
$tablename, incfield
$incfield, id
$id, [idfield
$idfield = 'id'], [inccount
$inccount = 1])
|
|
Increment a field by the given increment
Tags:
Parameters:
method insertObject [line 1704]
The insertObject(
object The
&$object, tablename
$tablename, [idcolumn
$idcolumn = 'id'], [preserve
$preserve = false], [force
$force = false])
|
|
Generate and execute an insert SQL statement for the given object
Tags:
Parameters:
method insertObjectArray [line 1674]
The insertObjectArray(
objects
&$objects, tablename
$tablename, [idcolumn
$idcolumn = 'id'], [preserve
$preserve = false], [force
$force = false])
|
|
Loop through the array and feed it to DBUtil::insertObject()
Tags:
Parameters:
method marshallFieldArray [line 667]
The marshallFieldArray(
result
$result, [closeResultSet
$closeResultSet = true], [assocKey
$assocKey = ''], [
$clean = true])
|
|
Transform a result set into an array of field values
Tags:
Parameters:
method marshallObjects [line 500]
The marshallObjects(
result
$result, objectColumns
$objectColumns, [closeResultSet
$closeResultSet = true], [assocKey
$assocKey = ''], [clean
$clean = true], [permissionFilter
$permissionFilter = null], [tablename
$tablename = null])
|
|
Transform a SQL query result set into an object/array, optionally applying an PN permission filter
Tags:
Parameters:
method metaColumnNames [line 2844]
void metaColumnNames(
tablename
$tablename, [numericIndex
$numericIndex = false])
|
|
get a list of column names in a table
Tags:
Parameters:
method metaColumns [line 2743]
void metaColumns(
tablename
$tablename, [notcasesensitive
$assoc = false], [
$notcasesensitive = true])
|
|
get a list of columns in a table
Tags:
Parameters:
method metaColumnType [line 2777]
void metaColumnType(
tablename
$tablename, column
$column, [showAutoIncrement
$showAutoIncrement = false], [showDefault
$showDefault = false])
|
|
get a the ADODB meta-type for a table column
Tags:
Parameters:
method metaDatabases [line 2712]
get a list of databases available on the server
Tags:
method metaForeignKeys [line 2887]
void metaForeignKeys(
tablename
$tablename, [owner
$owner = false], [upper
$upper = false])
|
|
get a list of foreign keys for a table
Tags:
Parameters:
method metaIndexes [line 2909]
void metaIndexes(
table
$tablename, [primary
$primary = false], [owner
$owner = false])
|
|
get a list of indexes for a table
Tags:
Parameters:
method metaPrimaryKeys [line 2865]
void metaPrimaryKeys(
tablename
$tablename, [owner
$owner = false])
|
|
get a list of primary keys for a table
Tags:
Parameters:
method metaTables [line 2728]
void metaTables(
[ttype
$ttype = false], [showSchema
$showSchema = false], [mask
$mask = false])
|
|
get a list of tables in the currently connected database
Tags:
Parameters:
method objectCache [line 1287]
void &objectCache(
[bool
$clear = false], [string
$tablename = null])
|
|
Object cache interface
Call without parameters to fetch cache. Call with $clear=true to clear the cache (optionally only for one specific table).
Parameters:
method renameColumn [line 2602]
void renameColumn(
tablename
$tablename, oldcolumn
$oldcolumn, newcolumn
$newcolumn, [fields
$fields = null])
|
|
rename column(s) in a table
Tags:
Parameters:
method renameTable [line 2430]
bool renameTable(
tablename
$tablename,
$newtablename)
|
|
rename database table
Parameters:
method selectExpandedFieldArray [line 891]
The selectExpandedFieldArray(
tablename
$tablename, joinInfo
$joinInfo, field
$field, [where
$where = ''], [orderby
$orderby = ''], [distinct
$distinct = false], [assocKey
$assocKey = ''], [permissionFilter
$permissionFilter = null])
|
|
Select & return an expanded field array
Tags:
Parameters:
method selectExpandedObject [line 1399]
The selectExpandedObject(
tablename
$tablename, joinInfo
$joinInfo, [where
$where = ''], [columnArray
$columnArray = null], [permissionFilter
$permissionFilter = null], [categoryFilter
$categoryFilter = null])
|
|
Select & return a object with it's left join fields filled in
Tags:
Parameters:
method selectExpandedObjectArray [line 1604]
The selectExpandedObjectArray(
tablename
$tablename, joinInfo
$joinInfo, [where
$where = ''], [orderby
$orderby = ''], [limitOffset
$limitOffset = -1], [limitNumRows
$limitNumRows = -1], [assocKey
$assocKey = ''], [permissionFilter
$permissionFilter = null], [columnArray
$categoryFilter = null], [
$columnArray = null])
|
|
Select & return an array of objects with it's left join fields filled in
Tags:
Parameters:
method selectExpandedObjectByID [line 1427]
The selectExpandedObjectByID(
tablename
$tablename, joinInfo
$joinInfo, id
$id, [field
$field = 'id'], [columnArray
$columnArray = null], [permissionFilter
$permissionFilter = null], [categoryFilter
$categoryFilter = null], [transformFunc
$transformFunc = null])
|
|
Select & return an object by it's ID with it's left join fields filled in
Tags:
Parameters:
method selectExpandedObjectCount [line 1210]
The selectExpandedObjectCount(
tablename
$tablename, joinInfo
$joinInfo, [where
$where = ''], [distinct
$distinct = false])
|
|
Return the number of rows affected
Tags:
Parameters:
method selectField [line 1027]
The selectField(
tablename
$tablename, field
$field, [where
$where = ''])
|
|
Select & return a field
Tags:
Parameters:
method selectFieldArray [line 832]
The selectFieldArray(
tablename
$tablename, field
$field, [where
$where = ''], [orderby
$orderby = ''], [distinct
$distinct = false], [assocKey
$assocKey = ''])
|
|
Select & return a field array
Tags:
Parameters:
method selectFieldArrayByID [line 867]
The selectFieldArrayByID(
tablename
$tablename, field
$field, id
$id, [idfield
$idfield = 'id'])
|
|
Select & return an array of field by an ID-field value
Tags:
Parameters:
method selectFieldByID [line 1008]
The selectFieldByID(
tablename
$tablename, field
$field, id
$id, [idfield
$idfield = 'id'])
|
|
Select & return a field by an ID-field value
Tags:
Parameters:
method selectFieldMax [line 932]
The selectFieldMax(
tablename
$tablename, field
$field, [option
$option = 'MAX'], [where
$where = ''])
|
|
Select & return the max/min value of a field
Tags:
Parameters:
method selectFieldMaxArray [line 968]
The selectFieldMaxArray(
tablename
$tablename, field
$field, [option
$option = 'MAX'], [where
$where = ''], [assocKey
$assocKey = ''])
|
|
Select & return the max/min array of a field grouped by the associated key
Tags:
Parameters:
method selectObject [line 1110]
The selectObject(
tablename
$tablename, [where
$where = ''], [columnArray
$columnArray = null], [permissionFilter
$permissionFilter = null], [categoryFilter
$categoryFilter = null], [
$cacheObject = true])
|
|
Select & return a specific object based on a PN table definition
Tags:
Parameters:
method selectObjectArray [line 1459]
The selectObjectArray(
tablename
$tablename, [where
$where = ''], [orderby
$orderby = ''], [limitOffset
$limitOffset = -1], [limitNumRows
$limitNumRows = -1], [assocKey
$assocKey = ''], [permissionFilter
$permissionFilter = null], [categoryFilter
$categoryFilter = null], [columnArray
$columnArray = null])
|
|
Select & return an object array based on a PN table definition
Tags:
Parameters:
method selectObjectArrayFilter [line 1540]
The selectObjectArrayFilter(
tablename
$tablename, [where
$where = ''], [orderby
$orderby = ''], [limitOffset
$limitOffset = -1], [limitNumRows
$limitNumRows = -1], [assocKey
$assocKey = ''], filterCallback
$filterCallback, [columnArray
$categoryFilter = null], [
$columnArray = null])
|
|
Select & return an object array based on a PN table definition
The result is filtered by a callback object passed into the function. This object must have implemented a method called "checkResult" which is passed the resulting data rows one by one. The "checkResult" function returns true if the datarow is ok, otherwise it returns false.
Example: class myFilter
{
var $userId;
function checkResult($datarow)
{
return $datarow['ownerUserId'] == $this->userId;
}
}
Tags:
Parameters:
method selectObjectByID [line 1320]
The selectObjectByID(
tablename
$tablename, id
$id, [field
$field = 'id'], [columnArray
$columnArray = null], [permissionFilter
$permissionFilter = null], [categoryFilter
$categoryFilter = null], [cacheObject
$cacheObject = true], [transformFunc
$transformFunc = null])
|
|
Select & return a specific object by using the ID field
Tags:
Parameters:
method selectObjectCount [line 1141]
The selectObjectCount(
tablename
$tablename, [where
$where = ''], [column
$column = '1'], [distinct
$distinct = false], [categoryFilter
$categoryFilter = null])
|
|
Return the number of rows affected
Tags:
Parameters:
method selectObjectCountByID [line 1178]
The selectObjectCountByID(
tablename
$tablename, id
$id, [field
$field = 'id'], [transformFunc
$transformFunc = ''])
|
|
Select an object count by ID
Tags:
Parameters:
method selectObjectSQL [line 1067]
The selectObjectSQL(
sql
$sql, tablename
$tablename, [columnArray
$columnArray = null], [permissionFilter
$permissionFilter = null], [
$cacheObject = true])
|
|
Select & return a specific object using the given sql statement
Tags:
Parameters:
method selectObjectSum [line 1253]
The selectObjectSum(
tablename
$tablename, column
$column, [where
$where = ''], [categoryFilter
$categoryFilter = null])
|
|
Return the sum of a column
Tags:
Parameters:
method selectScalar [line 1362]
mixed selectScalar(
$sql, [
$exitOnError = true])
|
|
Execute SQL select statement and return the value of the first column in the first row
Mostly usefull for places where you want to do a "select count(*)" or similar scalar selection.
Tags:
Parameters:
method serverInfo [line 2927]
return server information
Tags:
method SQLCache [line 1045]
void &SQLCache(
[bool
$clear = false])
|
|
SQL cache interface
Call without parameters to fetch cache. Call with $clear=true to clear the cache.
Parameters:
method truncateTable [line 2407]
bool truncateTable(
tablename
$tablename)
|
|
truncate database table
Parameters:
method updateObject [line 1862]
The updateObject(
object The
&$object, tablename
$tablename, [where
$where = ''], [idcolumn
$idcolumn = 'id'], [force
$force = false], [updateid
$updateid = false])
|
|
Generate and execute an update SQL statement for the given object
Tags:
Parameters:
method updateObjectArray [line 1981]
The updateObjectArray(
objects
&$objects, tablename
$tablename, [idcolumn
$idcolumn = 'id'], [force
$force = false])
|
|
Loop through the array and feed it to DBUtil::updateObject()
Tags:
Parameters:
method _addMarshalledObjectCount [line 191]
Nothing, _addMarshalledObjectCount(
count
$count)
|
|
Add the specified value to the gobal object marshall counter
This function is workaround for PHP4 limitations when passing default arguments by reference
Tags:
Parameters:
method _checkOrderByClause [line 244]
The _checkOrderByClause(
orderby
$orderby, [tablename
$tablename = null])
|
|
Convenience function to ensure that the order-by-clause starts with "ORDER BY"
Tags:
Parameters:
method _checkOrderByField [line 310]
string _checkOrderByField(
[field
$tablename = ''], [
$field = ''])
|
|
Convenience function to ensure that the field to be used as ORDER BY is not a CLOB/BLOB when using Oracle
Tags:
Parameters:
method _checkWhereClause [line 220]
The _checkWhereClause(
where
$where)
|
|
Convenience function to ensure that the where-clause starts with "WHERE"
Tags:
Parameters:
method _formatForStore [line 437]
string _formatForStore(
@value
$value)
|
|
Format value for use in SQL statement
Special handling for integers and booleans (the last is required for MySQL 5 strict mode)
Tags:
Parameters:
method _generateCategoryFilter [line 740]
The _generateCategoryFilter(
categoryFilter
$tablename, returnArray
$categoryFilter, [
$returnArray = false])
|
|
Build a list of objects which are mapped to the specified categories
Tags:
Parameters:
method _getAllColumns [line 372]
The _getAllColumns(
tablename
$tablename, [columnArray
$columnArray = null])
|
|
Same as PN Api function but without AS aliasing
Tags:
Parameters:
method _getAllColumnsQualified [line 406]
The _getAllColumnsQualified(
tablename
$tablename, tablealias
$tablealias, [columnArray
$columnArray = null])
|
|
Same as PN Api function but returns fully qualified fieldnames
Tags:
Parameters:
method _getFetchedObjectCount [line 157]
The _getFetchedObjectCount(
)
|
|
Get the gobal object fetch counter
This function is workaround for PHP4 limitations when passing default arguments by reference
Tags:
method _getMarshalledObjectCount [line 204]