Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cDb
  • cDbDriverAbstract
  • cDbDriverHandler
  • cDbDriverMysql
  • cDbDriverMysqli

Exceptions

  • cDbException
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cDbDriverAbstract

This class contains abstract method definitions for each database driver in CONTENIDO.

Direct known subclasses

cDbDriverMysql, cDbDriverMysqli
Abstract
Package: Core\Database
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Dominik Ziegler
Located at classes/db/class.db.driver.abstract.php
Methods summary
public
# __construct( array $dbCfg )

Constructor of the database driver. Currently stores the given configuration locally.

Constructor of the database driver. Currently stores the given configuration locally.

Parameters

$dbCfg
array
$dbCfg database configuration
public
# setHandler( cDbDriverHandler $handler )

Sets the database driver handler.

Sets the database driver handler.

Parameters

$handler
cDbDriverHandler
$handler database driver handler instance
public cDbDriverHandler
# getHandler( )

Returns the database driver handler instance.

Returns the database driver handler instance.

Returns

cDbDriverHandler
NULL
abstract public boolean
# check( )

Abstract method for checking database driver base functions. If this check fails, the database connection will not be established.

Abstract method for checking database driver base functions. If this check fails, the database connection will not be established.

Returns

boolean
abstract public object
# connect( )

Connects to the database.

Connects to the database.

Returns

object
resource int NULL value depends on used driver and is NULL in case of an error.
abstract public string
# buildInsert( string $tableName, array $fields )

Builds a insert query. String values in passed fields parameter will be escaped automatically.

Builds a insert query. String values in passed fields parameter will be escaped automatically.

Parameters

$tableName
string
$tableName The table name
$fields
array
$fields Associative array of fields to insert

Returns

string
The INSERT SQL query
abstract public string
# buildUpdate( string $tableName, array $fields, array $whereClauses )

Builds a update query. String values in passed fields and whereClauses parameter will be escaped automatically.

Builds a update query. String values in passed fields and whereClauses parameter will be escaped automatically.

Parameters

$tableName
string
$tableName The table name
$fields
array
$fields Assoziative array of fields to update
$whereClauses
array
$whereClauses Assoziative array of field in where clause. Multiple entries will be concatenated with AND

Returns

string
The UPDATE query
abstract public
# query( string $statement )

Executes the query.

Executes the query.

Parameters

$statement
string
$statement The query to execute
abstract public integer
# nextRecord( )

Moves the result to the next record, if exists and returns the status of the movement

Moves the result to the next record, if exists and returns the status of the movement

Returns

integer
Flag about move status 1 on success or 0
abstract public object
# getResultObject( string $className = NULL )

This method returns the current result set as object or NULL if no result set is left. If optional param $className is set, the result object is an instance of class $className.

This method returns the current result set as object or NULL if no result set is left. If optional param $className is set, the result object is an instance of class $className.

Parameters

$className
string
$className

Returns

object
abstract public integer
# affectedRows( )

Returns number of affected rows from last executed query (update, delete)

Returns number of affected rows from last executed query (update, delete)

Returns

integer
Number of affected rows
abstract public integer
# numRows( )

Returns the number of rows from last executed select query.

Returns the number of rows from last executed select query.

Returns

integer
The number of rows from last select query result
abstract public integer
# numFields( )

Returns the number of fields (columns) from current record set

Returns the number of fields (columns) from current record set

Returns

integer
Number of fields
abstract public
# free( )

Discard the query result

Discard the query result

abstract public string
# escape( string $string )

Escape string for using in SQL-Statement.

Escape string for using in SQL-Statement.

Parameters

$string
string
$string The string to escape

Returns

string
Escaped string
abstract public
# seek( integer $iPos = 0 )

Moves the cursor (position inside current result sets).

Moves the cursor (position inside current result sets).

Parameters

$iPos
integer
$iPos The positon to move to inside the current result set
abstract public array
# getMetaData( string $tableName, boolean $full = false )

Parses te table structure and generates a metadata from it.

Parses te table structure and generates a metadata from it.

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'])) { ...

Parameters

$tableName
string
$tableName The table to get metadata or empty string to retrieve metadata of all tables
$full
boolean
$full Flag to load full metadata

Returns

array
Depends on used database and on parameter $full
abstract public array
# getTableNames( )

Fetches all table names.

Fetches all table names.

Returns

array
abstract public array
# getServerInfo( )

Fetches server information.

Fetches server information.

Returns

array
abstract public integer
# getErrorNumber( )

Returns error code of last occured error by using databases interface.

Returns error code of last occured error by using databases interface.

Returns

integer
abstract public string
# getErrorMessage( )

Returns error message of last occured error by using databases interface.

Returns error message of last occured error by using databases interface.

Returns

string
abstract public
# disconnect( )

Closes the connection and frees the query id.

Closes the connection and frees the query id.

Properties summary
protected array $_dbCfg array()
#

Local database configuration.

Local database configuration.

protected cDbDriverHandler $_handler NULL
#

Driver handler instance.

Driver handler instance.

CMS CONTENIDO 4.9.2 API documentation generated by ApiGen 2.8.0