Inherited by PntMysqlDao, PntPdoDao, and PntSqliteDao.
|
| __construct ($connection=null) |
|
| getDbmsName () |
|
| supportsSelectRowCount () |
|
| runQuery ($query='', $error="Query error") |
|
| _runQuery ($error="Query error") |
|
| getFieldNames () |
|
| getRowCount () |
|
| getColumnCount () |
|
| getError () |
|
| getErrNo () |
|
| dataSeek ($index) |
|
| getSingleValue ($query='', $error="Query error") |
|
| getInsertId () |
|
| prefixColumnNames ($colNames, $prefix) |
|
| select_from ($columnNames, $tableName, $distinct=false) |
|
| where_equals ($columnName, $value, $placeholder='?') |
|
| limit ($rowCount, $offset=0) |
|
| joinAllById ($tableMap, $baseTable) |
|
| in ($columnName, $values) |
|
| convertToSql ($value) |
|
| convertConditionArgumentToSql ($value) |
|
| quote ($string) |
|
| setQueryToInsertObject_table_fieldMap ($anObject, $tableName, $fieldMap) |
|
| setQueryToSaveObject_table_fieldMap ($anObject, $tableName, $fieldMap, $insert) |
|
| setQueryToDeleteFrom_where_equals ($tableName, $columnName, $value) |
|
| addSqlFromSpec ($spec, $groupBy=false) |
|
| getAssocRows ($max=null) |
|
| getAssocRow () |
|
| release () |
|
| getConnection () |
|
| setConnection ($value) |
|
| setDefaultConnection () |
|
| connect () |
|
| beginTransaction () |
|
| commit () |
|
| rollBack () |
|
| param ($value, $placeholder='?') |
|
| clearParams () |
|
| replacePlaceholders () |
|
| addFieldPropsTo_table ($obj, $tableName, $includeList=null) |
|
| addFieldPropTo_row ($obj, $row) |
|
| getPropertyType ($mySqlType) |
|
__construct |
( |
|
$connection = null | ) |
|
_runQuery |
( |
|
$error = "Query error" | ) |
|
addFieldPropsTo_table |
( |
|
$obj, |
|
|
|
$tableName, |
|
|
|
$includeList = null |
|
) |
| |
Probably only works with MySQL Adds fieldProperties to the object for the columns from the database. This method assumes column names to be equal to the names of their corresponding field properties.
- Parameters
-
PntDbObject | $obj | the object to add fieldProperties to |
String | $tableName | the name of the table whose columns to use. |
array | $includeList | names of properties to include If omitted, all columns will be used in the order they appear in the table, but if a fieldProperty is already defined it is left untouched. |
- Returns
- array propertyDescriptors that where added, by property name
addFieldPropTo_row |
( |
|
$obj, |
|
|
|
$row |
|
) |
| |
addSqlFromSpec |
( |
|
$spec, |
|
|
|
$groupBy = false |
|
) |
| |
Add both the join clauses, the WHERE clause and eventual ORDER BY clause from the suppleid SQL spec. PntSqlSpec $spec Object that sepecifies the query and may generate the SQL
Database specific code to make a connection with the database. Sets the resulting dbSource on the connection and in $this->dbSource
convertConditionArgumentToSql |
( |
|
$value | ) |
|
Gets next row as associative array, or false if none
getAssocRows |
( |
|
$max = null | ) |
|
Gets rows starting at current pointer position !!Does no longer reset recordpointer
- Parameters
-
number | $max | The maximum number of rows to get. If null all remaining rows are returned. Returns an array of associative row arrays (indexed[rowIndex][rowName]) |
Return the error message or null if no error
Return the id of the new record after an insert
getPropertyType |
( |
|
$mySqlType | ) |
|
Number of affected rows with INSERT, UPDATE or DELETE. If supportsSelectRowCount returns number of selected rows
getSingleValue |
( |
|
$query = '' , |
|
|
|
$error = "Query error" |
|
) |
| |
in |
( |
|
$columnName, |
|
|
|
$values |
|
) |
| |
joinAllById |
( |
|
$tableMap, |
|
|
|
$baseTable |
|
) |
| |
limit |
( |
|
$rowCount, |
|
|
|
$offset = 0 |
|
) |
| |
append a SQL string to the query field. Return the added SQL.
- Parameters
-
number | $rowCount | The maximum number of rows to retrieve |
number | $offset | The index of the first row to retrieve |
param |
( |
|
$value, |
|
|
|
$placeholder = '?' |
|
) |
| |
Add parameter value for later use with statement execute. Instead of a type parameter the actual type of $value will be used for correct binding. I.e. booleans will be bound as booleans, strings as strings etc. However, not all subclasses support type specific binding. (PntPdoDao binds all as string)
- Parameters
-
mixed | $value | value to add |
string | $placeholder,. | default '?' |
- Returns
- String placehoder
prefixColumnNames |
( |
|
$colNames, |
|
|
|
$prefix |
|
) |
| |
Return an new array with prefixes added to the supplied columnNames separate prefix and columnname by the separarator appropriate for this database (usually a dot). Retain the keys so that if the columnNames array is a fielMap, the result will map the fields to prefixed columnNames
- Parameters
-
$colNames | Array with columnnames as the values |
$prefix,usually | the table name |
- Returns
- Array with prefixed columnNames
Parameter binding emulation. Replace the placeolders by converted parameter values
- Returns
- string sql sets $this->error if wrong parameter count
runQuery |
( |
|
$query = '' , |
|
|
|
$error = "Query error" |
|
) |
| |
select_from |
( |
|
$columnNames, |
|
|
|
$tableName, |
|
|
|
$distinct = false |
|
) |
| |
append a SQL string to the query field. Return the added SQL.
- Parameters
-
columnNames | Array with columnNames. If the names need to be prefixed, they must already be prefixed. |
tableName | String May also hold a String with a Join of tablenames |
setQueryToDeleteFrom_where_equals |
( |
|
$tableName, |
|
|
|
$columnName, |
|
|
|
$value |
|
) |
| |
Set the query field to a SQL string that saves the specified object field values in the database.
- Parameters
-
anObject | Object whose field values need to be saved String |
columnMap | Array |
setQueryToInsertObject_table_fieldMap |
( |
|
$anObject, |
|
|
|
$tableName, |
|
|
|
$fieldMap |
|
) |
| |
Set the query field to a SQL string that inserts the specified object field values in the database.
- Parameters
-
$anObject | Object whose field values need to be saved |
$tableName | String |
$fieldMap | Associative Array mapping fieldName to columnName |
setQueryToSaveObject_table_fieldMap |
( |
|
$anObject, |
|
|
|
$tableName, |
|
|
|
$fieldMap, |
|
|
|
$insert |
|
) |
| |
Set the query field to a SQL string that saves the specified object field values in the database.
- Parameters
-
anObject | Object whose field values need to be saved String |
fieldMap | Associative Array mapping fieldName to columnName |
insert | wheather a record for the object should be inserted. If false the objects record will be updated |
supportsSelectRowCount |
( |
| ) |
|
- Returns
- boolean wheather this does support rowcount for SELECT results For some drivers/dsbs this may actually depend on the cursor type used. If this function returns true, dataSeek should be supported too
where_equals |
( |
|
$columnName, |
|
|
|
$value, |
|
|
|
$placeholder = '?' |
|
) |
| |
append a SQL string to the query field. Return the added SQL. As of version 2.1 this method assumes paramerized queries.
- Parameters
-
| string | columnName The name of the column. If the name needs to be prefixed, it must already be prefixed. |
mixed | $value | |
mixed | $placeholder | to use (parameterized queries) |
$dbSource cache, see PntDatabasenConnection::getDBSource()
Index of current row (the one that can be fetched) in resultSet
The documentation for this class was generated from the following file: