This class contains abstract method definitions for each database driver in CONTENIDO.
package | Core |
---|---|
subpackage | Database |
__construct(array $dbCfg) : \cDbDriverAbstract
Currently stores the given configuration locally.
array
database configuration
affectedRows() : int
int
Number of affected rowsbuildInsert(string $tableName, array $fields) : string
String values in passed fields parameter will be escaped automatically.
string
The table name
array
Associative array of fields to insert
string
The INSERT SQL querybuildUpdate(string $tableName, array $fields, array $whereClauses) : string
String values in passed fields and whereClauses parameter will be escaped automatically.
string
The table name
array
Assoziative array of fields to update
array
Assoziative array of field in where clause. Multiple entries will be concatenated with AND
string
The UPDATE querycheck() : bool
If this check fails, the database connection will not be established.
bool
connect() : object | resource | int | null
object
resource
int
null
Connection handler. Return value depends on
used driver and is null in case of an error.disconnect() : void
escape(string $string) : string
string
The string to escape
string
Escaped stringfree() : int
int
getErrorMessage() : string
string
getErrorNumber() : int
int
getMetaData(string $tableName, bool $full) : array
Due to compatibility problems with Table we changed the behavior of metadata(); depending on $full, metadata returns the following values:
full is false (default): $result[]: [0]["table"] table name [0]["name"] field name [0]["type"] field type [0]["len"] field length [0]["flags"] field flags
full is true $result[]: ["num_fields"] number of metadata records [0]["table"] table name [0]["name"] field name [0]["type"] field type [0]["len"] field length [0]["flags"] field flags ["meta"][field name] index of field named "field name" This last one could be used if you have a field name, but no index. Test: if (isset($result['meta']['myfield'])) { ...
string
The table to get metadata or empty string to retrieve metadata of all tables
bool
Flag to load full metadata
array
Depends on used database and on parameter $fullgetResultObject($className) : object
If optional param $className is set, the result object is an instance of class $className.
object
getServerInfo() : array
array
getTableNames() : array
array
nextRecord() : int
int
Flag about move status 1 on success or 0numFields() : int
int
Number of fieldsnumRows() : int
int
The number of rows from last select query resultquery(string $statement) : void
string
The query to execute
seek(int $iPos) : void
int
The positon to move to inside the current result set
setHandler(\cDbDriverHandler $handler) : void
$_dbCfg : array
$_handler : \cDbDriverHandler