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.
arraydatabase configuration
affectedRows() : int
intNumber of affected rowsbuildInsert(string $tableName, array $fields) : string
String values in passed fields parameter will be escaped automatically.
stringThe table name
arrayAssociative array of fields to insert
stringThe INSERT SQL querybuildUpdate(string $tableName, array $fields, array $whereClauses) : string
String values in passed fields and whereClauses parameter will be escaped automatically.
stringThe table name
arrayAssoziative array of fields to update
arrayAssoziative array of field in where clause. Multiple entries will be concatenated with AND
stringThe UPDATE querycheck() : bool
If this check fails, the database connection will not be established.
boolconnect() : object | resource | int | null
objectresourceintnullConnection handler. Return value depends on
used driver and is null in case of an error.disconnect() : void
escape(string $string) : string
stringThe string to escape
stringEscaped stringfree() : int
intgetErrorMessage() : string
stringgetErrorNumber() : int
intgetMetaData(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'])) { ...
stringThe table to get metadata or empty string to retrieve metadata of all tables
boolFlag to load full metadata
arrayDepends on used database and on parameter $fullgetResultObject($className) : object
If optional param $className is set, the result object is an instance of class $className.
objectgetServerInfo() : array
arraygetTableNames() : array
arraynextRecord() : int
intFlag about move status 1 on success or 0numFields() : int
intNumber of fieldsnumRows() : int
intThe number of rows from last select query resultquery(string $statement) : void
stringThe query to execute
seek(int $iPos) : void
intThe positon to move to inside the current result set
setHandler(\cDbDriverHandler $handler) : void
$_dbCfg : array
$_handler : \cDbDriverHandler