Docs For Class atkDb
Atk API home Class tree Element index

Todo list

Packages: » atk Classes: general » AllTests » atkConfig » atkController » atkDataNode » atkErrorHandlerBase » atkFileEditor » atkLanguage » atkMailErrorHandler » atkMetaNode » atkMockNode » atkNode » atkNodeValidator » atkOneToManyRelationSessionGridHandler » atkPHPView » atkSessionStore » atkStatementIterator » atkTreeNode » atkWizardBase » atkZendPlatformErrorHandler » clsTbsDataSource » clsTbsLocator » clsTinyButStrong » clsTinyButStrongOOo » FCKeditor » getSupportedLanguagesCollector » layout » node » sql_whereclause_blacklist_checker » test » tree utils » atkAbstractFrame » atkActionListener » atkClassFinder » atkClassLoader » atkCompatSelector » atkDataHolder » atkDebugger » atkDirectoryTraverser » atkEventLog » atkFileUtils » atkFrame » atkFrameSet » atkIpUtils » atkJSON » atkMail » atkMailer » atkMessageQueue » atkMLSelector » atkmlsplitter » atkRootFrameset » atkSelector » atkSelectorIterator » atkString » atkStringParser » atkTableRenderer » atkTableRendererGrouped » atkTextMarker » atkTmpFile » atkTriggerListener » atkYAML » atkZip » browserInfo fixture » atkAbstractFixtureLoader » atkFixtureManager » atkPHPFixtureLoader » atkYAMLFixtureLoader testcases » atkAbstractSearchHandler ui » atkActionBoxBuilder » atkDialog » atkIndexPage » atkOutput » atkPage » atkPageBuilder » atkTheme » atkThemeCompiler » atkUI handlers » atkActionHandler » atkAddHandler » atkAddOrCopyHandler » atkAdminHandler » atkAttributeEditHandler » atkCopyHandler » atkDeleteHandler » atkDocumentHandler » atkEditCopyHandler » atkEditHandler » atkExportHandler » atkFeedbackHandler » atkFileExport » atkImportHandler » atkMultiSelectHandler » atkMultiUpdatehandler » atkSaveHandler » atkSearchHandler » atkSelectHandler » atkSmartSearchHandler » atkUpdatehandler » atkViewEditBase » atkViewHandler » atkXmlHandler attributes » atkAggregatedColumn » atkAttribute » atkBoolAttribute » atkCalculatorAttribute » atkCaptchaAttribute » atkColorPickerAttribute » atkCountryAttribute » atkCreatedByAttribute » atkCreateStampAttribute » atkCurrencyAttribute » atkDateAttribute » atkDateTimeAttribute » atkDocumentAttribute » atkDummyAttribute » atkDurationAttribute » atkEmailAttribute » atkExpressionAttribute » atkFckAttribute » atkFieldSet » atkFileAttribute » atkFileWriterAttribute » atkFlagAttribute » atkFormatAttribute » atkFuzzySearchAttribute » atkHiddenAttribute » atkHtmlAttribute » atkIpAttribute » atkListAttribute » atkLiveTextPreview » atkMlAttribute » atkMlFckAttribute » atkMlHtmlAttribute » atkMlNumberAttribute » atkMlSelectorAttribute » atkMlTextAttribute » atkMlWrapper » atkMultipleFileAttribute » atkMultiSelectAttribute » atkNumberAttribute » atkParserAttribute » atkPasswordAttribute » atkProfileAttribute » atkRadioAttribute » atkRadioDetailsAttribute » atkRowCounter » atkStateAttribute » atkTabbedPane » atkTagAttribute » atkTextAttribute » atkTimeAttribute » atkTimeZoneAttribute » atkToolbar » atkUpdatedByAttribute » atkUpdateStampAttribute » atkUrlAttribute » atkWeekdayAttribute » atkWysiwygAttribute datatypes » atkArrayDt » atkDataType » atkStringDt » atkTime subpackage » atkAttributeTestCase security » atkBajusEncryption » atkBase64Encryption » atkEncryption » atkMockSecurityManager » atkOpenSSLEncryption » atkSecurityListener » atkSecurityManager » atkUrlVault » auth_config » auth_db » auth_imap » auth_interface » auth_ldap » auth_none » auth_pop3 » auth_saml » auth_server » auth_sspi cache » atkCache » atkCache_apc » atkCache_eaccelerator » atkCache_file » atkCache_memcache » atkCache_var » atkCache_xcache » atkCache_zp_disk » atkCache_zp_output » atkCache_zp_shm test » atkCacheTestCase » atkPluginTestCase » atkTestCase » test_sql_whereclause_blacklist_checker db » atkClusterDb » atkClusterDDL » atkClusterQuery » atkDb » atkdb2db » atkDb2DDL » atkDb2Query » atkDDL » atki5db » atki5DDL » atki5query » atkMockDb » atkMockDDL » atkMockQuery » atkMsSqlDb » atkMsSqlDDL » atkMssqlQuery » atkMysqlDb » atkMysqlDDL » atkMysqliDb » atkMysqliDDL » atkMysqliQuery » atkMysqlQuery » atkOci8Db » atkOci8DDL » atkOci8Query » atkOci9Db » atkOci9DDL » atkOci9Query » atkOci805Db » atkOci805Query » atkPgsqlDb » atkPgsqlDDL » atkPgsqlQuery » atkQuery recordlist » atkColumnConfig » atkCSVRecordList » atkCustomRecordList » atkExcelCSVRecordList » atkHTMLRecordList » atkPrintableRecordList » atkRecordList » atkRecordlistCache » atkTotalizer db-statement » atkCompatStatement » atkMySQLiStatement » atkStatement » atkStatementException » atkStatementParser console » atkConsoleController menu » atkcookmenu » atkDhtmlMenu » atkDropdownMenu » atkFramesMenu » atkMenu » atkmenuinterface » atkModernMenu » atkOutlookMenu » atkPlainMenu datagrid » atkDataGrid » atkDGComponent » atkDGEditControl » atkDGEvent » atkDGIndex » atkDGLimit » atkDGList » atkDGNoRecordsFound » atkDGPaginator » atkDGRenderer » atkDGSummary lock » atkDbLock » atkLock filters » atkDistinctFilter » atkFilter » atkGroupByFilter document » atkDocumentWriter » atkDocxWriter » atkOpenDocumentWriter meta » atkDutchMetaGrammar » atkMetaAttributeModifier » atkMetaCompiler » atkMetaGrammar » atkMetaPolicy » mod_meta relations » atkExtendableShuttleRelation » atkManyBoolRelation » atkManyToManyListRelation » atkManyToManyRelation » atkManyToManySelectRelation » atkManyToOneRelation » atkManyToOneTreeRelation » atkMatrixRelation » atkOneToManyRelation » atkOneToOneRelation » atkPolymorphicOneToOneRelation » atkRelation » atkSecureRelation » atkShuttleControl » atkShuttleFilter » atkShuttleRelation front » atkFrontController » atkFrontControllerBridge keyboard » atkKeyboard meta-relations » atkMetaExtendableShuttleRelation » atkMetaManyBoolRelation » atkMetaManyToManyListRelation » atkMetaManyToManySelectRelation » atkMetaManyToOneRelation » atkMetaOneToManyRelation » atkMetaOneToOneRelation » atkMetaShuttleRelation session » atkMockSessionManager » atkSessionManager » atkState modules » atkModule » mod_test listeners » atkRecycleBin interface » atkServer » atkSoapServer wizard » atkWizard » AtkWizardActionLoader » atkWizardPanel
Interfaces: datagrid » atkDGListener interface » atkServerInterface
Files: general » adodb-time.inc.php » AllTests.php » atknodetools.inc » atktools.inc » atktreetools.inc » basexml.php » bootstrap.inc » bootstrap.php » class.atkconfig.inc » class.atkcontroller.inc » class.atkdatanode.inc » class.atkerrorhandlerbase.inc » class.atkfileeditor.inc » class.atki5db.inc » class.atki5ddl.inc » class.atki5query.inc » class.atklanguage.inc » class.atkmailerrorhandler.inc » class.atkmetanode.inc » class.atkmocknode.inc » class.atkmocksessionmanager.inc » class.atknode.inc » class.atknodevalidator.inc » class.atkonetomanyrelationsessiongridhandler.inc » class.atkphpview.inc » class.atkpolymorphiconetoonerelation.inc » class.atksessionstore.inc » class.atkstatementiterator.inc » class.atktreenode.inc » class.atkwizardbase.inc » class.atkzendplatformerrorhandler.inc » class.layout.inc » class.nodename.inc » class.sql_whereclause_blacklist_checker.inc » class.test.inc » class.test_sql_whereclause_blacklist_checker.inc » commands.php » config.modules.inc » config.php » connector.php » console.php » db2yaml.php » defaultconfig.inc.php » fckeditor.php » fckeditor_php4.php » fckeditor_php5.php » io.php » module.inc » phpcompat.php » server.php » spellchecker.php » table2yaml.php » tbsooo_class.php » tbs_class.php » tooltip.tpl.php » upload.php » util.php » version.inc attributes » class.atkaggregatedcolumn.inc » class.atkattribute.inc » class.atkboolattribute.inc » class.atkcalculatorattribute.inc » class.atkcaptchaattribute.inc » class.atkcolorpickerattribute.inc » class.atkcountryattribute.inc » class.atkcreatedbyattribute.inc » class.atkcreatestampattribute.inc » class.atkcurrencyattribute.inc » class.atkdateattribute.inc » class.atkdatetimeattribute.inc » class.atkdocumentattribute.inc » class.atkdummyattribute.inc » class.atkdurationattribute.inc » class.atkemailattribute.inc » class.atkexpressionattribute.inc » class.atkfckattribute.inc » class.atkfieldset.inc » class.atkfileattribute.inc » class.atkfilewriterattribute.inc » class.atkflagattribute.inc » class.atkformatattribute.inc » class.atkfuzzysearchattribute.inc » class.atkhiddenattribute.inc » class.atkhtmlattribute.inc » class.atkipattribute.inc » class.atklistattribute.inc » class.atklivetextpreview.inc » class.atkmlattribute.inc » class.atkmlfckattribute.inc » class.atkmlhtmlattribute.inc » class.atkmlnumberattribute.inc » class.atkmlselectorattribute.inc » class.atkmltextattribute.inc » class.atkmlwrapper.inc » class.atkmultiplefileattribute.inc » class.atkmultiselectattribute.inc » class.atknumberattribute.inc » class.atkparserattribute.inc » class.atkpasswordattribute.inc » class.atkprofileattribute.inc » class.atkradioattribute.inc » class.atkradiodetailsattribute.inc » class.atkrowcounter.inc » class.atkstateattribute.inc » class.atktabbedpane.inc » class.atktagattribute.inc » class.atktextattribute.inc » class.atktimeattribute.inc » class.atktimezoneattribute.inc » class.atktoolbar.inc » class.atkupdatedbyattribute.inc » class.atkupdatestampattribute.inc » class.atkurlattribute.inc » class.atkweekdayattribute.inc » class.atkwysiwygattribute.inc attributes-- » property_accessor.php cache » class.atkcache.inc » class.atkcache_apc.inc » class.atkcache_eaccelerator.inc » class.atkcache_file.inc » class.atkcache_memcache.inc » class.atkcache_var.inc » class.atkcache_xcache.inc » class.atkcache_zp_disk.inc » class.atkcache_zp_output.inc » class.atkcache_zp_shm.inc console » class.atkconsolecontroller.inc datagrid » class.atkdatagrid.inc » class.atkdgcomponent.inc » class.atkdgeditcontrol.inc » class.atkdgevent.inc » class.atkdgindex.inc » class.atkdglimit.inc » class.atkdglist.inc » class.atkdglistener.inc » class.atkdgnorecordsfound.inc » class.atkdgpaginator.inc » class.atkdgrenderer.inc » class.atkdgsummary.inc datatypes » class.atkarraydt.inc » class.atkdatatype.inc » class.atkstringdt.inc » class.atktimedt.inc db » class.atkclusterdb.inc » class.atkclusterddl.inc » class.atkclusterquery.inc » class.atkdb.inc » class.atkdb2db.inc » class.atkdb2ddl.inc » class.atkdb2query.inc » class.atkddl.inc » class.atkmockdb.inc » class.atkmockddl.inc » class.atkmockquery.inc » class.atkmssqldb.inc » class.atkmssqlddl.inc » class.atkmssqlquery.inc » class.atkmysqldb.inc » class.atkmysqlddl.inc » class.atkmysqlidb.inc » class.atkmysqliddl.inc » class.atkmysqliquery.inc » class.atkmysqlquery.inc » class.atkoci8db.inc » class.atkoci8ddl.inc » class.atkoci8query.inc » class.atkoci9db.inc » class.atkoci9ddl.inc » class.atkoci9query.inc » class.atkoci805db.inc » class.atkoci805query.inc » class.atkpgsqldb.inc » class.atkpgsqlddl.inc » class.atkpgsqlquery.inc » class.atkquery.inc db-statement » class.atkcompatstatement.inc » class.atkmysqlistatement.inc » class.atkstatement.inc » class.atkstatementexception.inc » class.atkstatementparser.inc document » class.atkdocumentwriter.inc » class.atkdocxwriter.inc » class.atkopendocumentwriter.inc filters » class.atkdistinctfilter.inc » class.atkfilter.inc » class.atkgroupbyfilter.inc fixture » class.atkabstractfixtureloader.inc » class.atkfixturemanager.inc » class.atkphpfixtureloader.inc » class.atkyamlfixtureloader.inc front » class.atkfrontcontroller.inc » class.atkfrontcontrollerbridge.inc handlers » class.atkactionhandler.inc » class.atkaddhandler.inc » class.atkaddorcopyhandler.inc » class.atkadminhandler.inc » class.atkattributeedithandler.inc » class.atkcopyhandler.inc » class.atkdeletehandler.inc » class.atkdocumenthandler.inc » class.atkeditcopyhandler.inc » class.atkedithandler.inc » class.atkexporthandler.inc » class.atkfeedbackhandler.inc » class.atkfileexport.inc » class.atkimporthandler.inc » class.atkmultiselecthandler.inc » class.atkmultiupdatehandler.inc » class.atksavehandler.inc » class.atksearchhandler.inc » class.atkselecthandler.inc » class.atksmartsearchhandler.inc » class.atkupdatehandler.inc » class.atkvieweditbase.inc » class.atkviewhandler.inc » class.atkxmlhandler.inc include » autoload.inc » basics.inc » compatibility.inc » configs.inc » debugging.inc » errorhandler.inc » globals.inc » initial.inc » security.inc interface » class.atkserver.inc » class.atksoapserver.inc » interface.atkserverinterface.inc javascript » class.atkmultilanguage.js.php » class.atkprofileattribute.js.php » dhtml_tabs.js.php keyboard » class.atkkeyboard.inc listeners » class.atkrecyclebin.inc lock » class.atkdblock.inc » class.atklock.inc » lock.php lock-- » lock.js.php menu » atkmenutools.inc » class.atkcookmenu.inc » class.atkdhtmlmenu.inc » class.atkdropdownmenu.inc » class.atkframesmenu.inc » class.atkmenu.inc » class.atkmenuinterface.inc » class.atkmodernmenu.inc » class.atkoutlookmenu.inc » class.atkplainmenu.inc meta » class.atkdutchmetagrammar.inc » class.atkmetaattributemodifier.inc » class.atkmetacompiler.inc » class.atkmetagrammar.inc » class.atkmetapolicy.inc » module.inc meta-relations » class.atkmetaextendableshuttlerelation.inc » class.atkmetamanyboolrelation.inc » class.atkmetamanytomanylistrelation.inc » class.atkmetamanytomanyselectrelation.inc » class.atkmetamanytoonerelation.inc » class.atkmetaonetomanyrelation.inc » class.atkmetaonetoonerelation.inc » class.atkmetashuttlerelation.inc modules » class.atkmodule.inc modules-- » atkmoduletools.inc popups » colorpicker.inc recordlist » class.atkcolumnconfig.inc » class.atkcsvrecordlist.inc » class.atkcustomrecordlist.inc » class.atkexcelcsvrecordlist.inc » class.atkhtmlrecordlist.inc » class.atkprintablerecordlist.inc » class.atkrecordlist.inc » class.atkrecordlistcache.inc » class.atktotalizer.inc relations » class.atkextendableshuttlerelation.inc » class.atkmanyboolrelation.inc » class.atkmanytomanylistrelation.inc » class.atkmanytomanyrelation.inc » class.atkmanytomanyselectrelation.inc » class.atkmanytoonerelation.inc » class.atkmanytoonetreerelation.inc » class.atkmatrixrelation.inc » class.atkonetomanyrelation.inc » class.atkonetoonerelation.inc » class.atkrelation.inc » class.atksecurerelation.inc » class.atkshuttlecontrol.inc » class.atkshuttlefilter.inc » class.atkshuttlerelation.inc security » class.atkbajusencryption.inc » class.atkbase64encryption.inc » class.atkencryption.inc » class.atkmocksecuritymanager.inc » class.atkmocksecuritymanager.inc » class.atkopensslencryption.inc » class.atksecuritylistener.inc » class.atksecuritymanager.inc » class.atkurlvault.inc » class.auth_config.inc » class.auth_db.inc » class.auth_imap.inc » class.auth_interface.inc » class.auth_ldap.inc » class.auth_none.inc » class.auth_pop3.inc » class.auth_saml.inc » class.auth_server.inc » class.auth_sspi.inc session » class.atksessionmanager.inc » class.atkstate.inc skel » app.php » atk.inc » config.inc.php » debugger.php » dispatch.php » include.php » index.php » menu.php » top.php » welcome.php subpackage » class.atkattributetestcase.inc test » class.atkcachetestcase.inc » class.atkplugintestcase.inc » class.atktestcase.inc testcases » class.atkabstractsearchhandler.inc themes » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc » themedef.inc ui » block.atknavigator.php » block.atknavigatorinfo.php » class.atkactionboxbuilder.inc » class.atkdialog.inc » class.atkindexpage.inc » class.atkoutput.inc » class.atkpage.inc » class.atkpagebuilder.inc » class.atktheme.inc » class.atkthemecompiler.inc » class.atkui.inc » function.atkconf.php » function.atkconfig.php » function.atkdatefield.php » function.atkdispatchfile.php » function.atkfrontcontroller.php » function.atkloadscript.php » function.atkmessages.php » function.atkmoduledir.php » function.atkscript.php » function.atkstyle.php » function.atktext.php » function.atkthemeicon.php » function.atkthemeimg.php » function.stacktrace.php » modifier.atkjson.php » modifier.atkvardump.php » resource.string.php » resource.theme.php » resource.ui.php utils » atkbrowsertools.inc » class.atkactionlistener.inc » class.atkclassloader.inc » class.atkcompatselector.inc » class.atkdataholder.inc » class.atkdebugger.inc » class.atkdirectorytraverser.inc » class.atkeventlog.inc » class.atkfileutils.inc » class.atkframeset.inc » class.atkiputils.inc » class.atkjson.inc » class.atkmail.inc » class.atkmailer.inc » class.atkmessagequeue.inc » class.atkmlselector.inc » class.atkmlsplitter.inc » class.atkselector.inc » class.atkselectoriterator.inc » class.atkstring.inc » class.atkstringparser.inc » class.atktablerenderer.inc » class.atktablerenderergrouped.inc » class.atktextmarker.inc » class.atktmpfile.inc » class.atktriggerlistener.inc » class.atkyaml.inc » class.atkzip.inc » help.inc wizard » class.atkwizard.inc » class.atkwizardactionloader.inc » class.atkwizardpanel.inc
Home  ->  Documentation home  ->  Atk index  ->  Docs For Class atkDb [ package: atk ]

Class: atkDb

Source Location: /db/class.atkdb.inc

Class atkDb

Class Overview

Descendants

Child Class Description
atkClusterDb ATK driver for clustered databases. This class proxies queries to correct read/write slaves.
atkdb2db Driver for IBM DB2 databases.
atkMysqlDb Driver for MySQL databases.
atkOci8Db Driver for Oracle 8i databases.
atkPgsqlDb Database driver for PostgreSQL.
atkMockDb A mock database driver.

[ Top ]

Property Summary

int   $m_affected_rows   number of affected rows after an update/delete/insert query
boolean   $m_auto_free   Auto free result upon next query.
String   $m_charset   The character set.
String   $m_collate   The collate.
String   $m_connection   The current connection name.
String   $m_database   The name of the database/schema to use.
int   $m_errno   Contains error number, in case an error occurred.
String   $m_error   Contains textual error message, in case an error occurred.
mixed   $m_errorLookup   Internal use; error messages from language files are cached here
boolean   $m_haltonerror   If true, an atkerror is raised when an error occurred.
String   $m_host   The hostname/ip to connect to.
unknown_type   $m_identifierQuoting   Indentifier Quoting
Resource   $m_link_id   The connection is stored in this variable.
String   $m_mode   The mode for the connection.
String   $m_password   The password for the connection.
String   $m_port   The port for the connection.
Resource   $m_query_id   The query statement is stored in this variable.
array   $m_record   Contains the current record from the result set.
int   $m_row   Current row number
array   $m_tableMeta   array to cache meta-information about tables.
String   $m_type   Driver name.
String   $m_user   The username for the connection.
array   $m_user_error   List of error codes that could be caused by an end-user.
String   $m_vendor   Vendor.

[ Top ]

Method Summary

static void   clearMapping()   Clear the current database mapping.
static atkDb   &getInstance()   Get database instance.
static mixed   getMapping()   Returns the current database mapping.
static void   getTranslatedDatabaseName()   Returns the real database name. If a mapping
static void   useMapping()   Use the given mapping to translate database requests from one database to another database. This can be used for test purposes.
static mixed   _getOrUseMapping()   Get or set the database mapping
int   affected_rows()   Retrieve the number of rows affected by the last query.
void   cloneAll()   Clones the database structure of the given database to this database. This also means the complete database is emptied beforehand.
void   commit()   Commit the current transaction.
int   connect()   Connect to the database.
atkDDL   &createDDL()   Create an atkDDL object for constructing ddl queries.
atkQuery   &createQuery()   Create an atkQuery object for constructing queries.
void   deleteAll()   Empty all database tables.
void   disconnect()   Disconnect from database
void   doConnect()   Connect to the database
void   dropAll()   Drop all database tables.
string   errorLookup()   Looks up the error
String   escapeSQL()   escapes quotes for use in SQL: ' -> '' (and sometimes % -> %%)
unknown   func_concat()   Get CONCAT() equivalent for the current database.
string   func_concat_ws()   Get CONCAT_WS() equivalent for the current database.
String   func_datetimetochar()   Get TO_CHAR() equivalent for the current database.
String   func_datetochar()   Get TO_CHAR() equivalent for the current database.
void   func_now()   get NOW() or SYSDATE() equivalent for the current database
void   func_substring()   get SUBSTRING() equivalent for the current database.
int   getAtkDbErrno()   Get generic atk errorccode
mixed   getDbErrno()   Get vendor-dependent database error number.
String   getDbError()   Get vendor-dependent database error message.
DB_SUCCESS   getDbStatus()   Check if current db is present and acceptable for current user
String   getErrorMsg()   Get localized error message (for display in the application)
String   getErrorType()   Determine whether an error that occurred is a recoverable (user) error or a system error.
boolean   getHaltOnError()   Halt on error?
mixed   getQueryId()   Returns the current query resource.
string   getQueryMode()   Returns the query mode
array   getRow()   Returns the first row for the given query.
array   getRows()   Get all rows for the given query.
array   getRowsAssoc()   Get rows in an associative array with the given column used as key for the rows.
array   getSearchModes()   This function indicates what searchmodes the database supports.
String   getType()   Get the database driver type.
mixed   getValue()   Get a single value from a certain specified query
array   getValues()   Get an array with all the values in the specified column.
array   getValuesAssoc()   Get rows in an associative array with the given key column used as key and the given value column used as value.
void   halt()   If haltonerror is set, this will raise an atkerror. If not, it will place the error in atkdebug and continue.
void   hasError()   Has error?
bool   hasMode()   Check if the current instance has the given mode
atkDb   init()   (Re)Initialise a database driver with a connection
Connection   link_id()   Get the current connection.
boolean   lock()   Lock a table in the database.
Integer   maxIdentifierLength()   Returns the maximum length an identifier (tablename, columnname, etc) may have
array   metadata()   Return the meta data of a certain table HIE GEBLEVEN
int   nextid()   Get the next sequence number of a certain sequence.
mixed   next_record()   Retrieve the next record in the resultset.
atkStatement   prepare()   Creates a new statement for the given query.
void   query()   Parse and execute a query.
Resource   query_id()   Get the current query statement resource id.
string   quoteIdentifier()   Quote Indentifier
void   resetQueryId()   Rests the query resource.
void   rollback()   Rollback the current transaction.
void   savepoint()   Set savepoint with the given name.
void   setHaltOnError()   Halt on error or not?
void   &setInstance()   Replace the current instance of a named connection at runtime with a different connection. This is useful for example for replacing a named database instance with a mock object for testing purposes.
void   setQueryId()   Sets the current query identifier used for next_record() etc.
void   setSequenceValue()   Set database sequence value.
void   setUserError()   Define custom user error codes.
bool   tableExists()   This function checks the database for a table with the provide name
array   tableMeta()   Fetches table meta data from database
array   table_names()   Return the available table names
void   toggleForeignKeys()   Enable/disable all foreign key constraints.
boolean   unlock()   Relieve all locks.
String   vendorDateFormat()   Convert a php date() format specifier to a vendor specific format specifier.
array   _getTableMetaFromCache()   If cached it'll return the table metadata from cache.
array   _getTableMetaFromDb()   Returns the tablemetadata directly from db
int   _translateError()   Translate database-vendor dependent error messages into an ATK generic error code.

[ Top ]

Properties

int   $m_affected_rows = 0 [line 194]

number of affected rows after an update/delete/insert query

API Tags:
Access:  private


[ Top ]
boolean   $m_auto_free = true [line 225]

Auto free result upon next query.

When set to true, the previous results are cleared when a new query is executed. It should generally not be necessary to put this to false.

API Tags:
Access:  private


[ Top ]
String   $m_charset = "" [line 104]

The character set.

API Tags:
Access:  private


[ Top ]
String   $m_collate = "" [line 111]

The collate.

API Tags:
Access:  private


[ Top ]
String   $m_connection = "" [line 125]

The current connection name.

API Tags:
Access:  private


[ Top ]
String   $m_database = "" [line 76]

The name of the database/schema to use.

API Tags:
Access:  private


[ Top ]
int   $m_errno = 0 [line 146]

Contains error number, in case an error occurred.

API Tags:
Access:  private


[ Top ]
String   $m_error = "" [line 153]

Contains textual error message, in case an error occurred.

API Tags:
Access:  private


[ Top ]
mixed   $m_errorLookup = array() [line 241]

Internal use; error messages from language files are cached here

API Tags:
Access:  private


[ Top ]
boolean   $m_haltonerror = true [line 165]

If true, an atkerror is raised when an error occurred.

The calling script can use this to stop execution and rollback. If false, the error will be ignored and script execution continues. Use this only for queries that may fail but still be valid.

API Tags:
Access:  private


[ Top ]
String   $m_host = "" [line 69]

The hostname/ip to connect to.

API Tags:
Access:  private


[ Top ]
unknown_type   $m_identifierQuoting = array('start' => '"', 'end' => '"', 'escape' => '"') [line 248]

Indentifier Quoting

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
Resource   $m_link_id = 0 [line 208]

The connection is stored in this variable.

API Tags:
Access:  private


[ Top ]
String   $m_mode = "" [line 118]

The mode for the connection.

API Tags:
Access:  private


[ Top ]
String   $m_password = "" [line 90]

The password for the connection.

API Tags:
Access:  private


[ Top ]
String   $m_port = "" [line 97]

The port for the connection.

API Tags:
Access:  private


Redefined in descendants as:

[ Top ]
Resource   $m_query_id = 0 [line 215]

The query statement is stored in this variable.

API Tags:
Access:  private


[ Top ]
array   $m_record = array() [line 132]

Contains the current record from the result set.

API Tags:
Access:  private


[ Top ]
int   $m_row = 0 [line 139]

Current row number

API Tags:
Access:  private


[ Top ]
array   $m_tableMeta = array() [line 201]

array to cache meta-information about tables.

API Tags:
Access:  private


[ Top ]
String   $m_type = "" [line 176]

Driver name.

Derived classes should add their own m_type var to the class definition and put the correct name in it. (e.g. "mysql" etc.)

API Tags:
Abstract:  
Access:  private


Redefined in descendants as:

[ Top ]
String   $m_user = "" [line 83]

The username for the connection.

API Tags:
Access:  private


[ Top ]
array   $m_user_error = array() [line 235]

List of error codes that could be caused by an end-user.

This type of errors is 'recoverable'. An example is a violation of a unique constraint.

API Tags:
Access:  private


[ Top ]
String   $m_vendor = "" [line 187]

Vendor.

This is mainly used to retrieve things like error messages that are common for a vendor (i.e., they do not differ between versions).

API Tags:
Abstract:  
Access:  private


Redefined in descendants as:

[ Top ]

Methods

static method clearMapping  [line 293]

  static void clearMapping( )

Clear the current database mapping.



Redefined in descendants as:

[ Top ]
static method getInstance  [line 1304]

  static atkDb &getInstance( [String $conn = "default"], [Bool $reset = false], [String $mode = "rw"]  )

Get database instance.

This method instantiates and returns the correct (vendor specific) database instance, depending on the configuration.

Parameters:
String   $conn:  The name of the connection as defined in the config.inc.php file (defaults to 'default')
Bool   $reset:  Reset the instance to force the creation of a new instance
String   $mode:  The mode to connect with the database

API Tags:
Return:  Instance of the database class.
Access:  public


Redefined in descendants as:

[ Top ]
static method getMapping  [line 283]

  static mixed getMapping( )

Returns the current database mapping.

NULL if no mapping is active.


API Tags:
Return:  current database mapping (null if inactive)
Access:  public


Redefined in descendants as:

[ Top ]
static method getTranslatedDatabaseName  [line 308]

  static void getTranslatedDatabaseName( string $name  )

Returns the real database name. If a mapping

exists the mapping is used to translate the database name to it's real database name. If the database name is not part of the mapping or no mapping is set the given name will be returned.

Parameters:
string   $name:  database name

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
static method useMapping  [line 271]

  static void useMapping( array $mapping  )

Use the given mapping to translate database requests from one database to another database. This can be used for test purposes.

Parameters:
array   $mapping:  database mapping


Redefined in descendants as:

[ Top ]
static method _getOrUseMapping  [line 321]

  static mixed _getOrUseMapping( [array $mapping = "get"]  )

Get or set the database mapping

Parameters:
array   $mapping:  database mapping

API Tags:
Return:  current database mapping (null if inactive)
Access:  protected


Redefined in descendants as:

[ Top ]
affected_rows  [line 736]

  int affected_rows( )

Retrieve the number of rows affected by the last query.

After calling query() to perform an update statement, this method will return the number of rows that was updated.


API Tags:
Return:  The number of affected rows
Abstract:  


Redefined in descendants as:

[ Top ]
cloneAll  [line 1265]

  void cloneAll( &$otherDb, atkDb $otherDb  )

Clones the database structure of the given database to this database. This also means the complete database is emptied beforehand.

Parameters:
atkDb   $otherDb:  other database instance
   &$otherDb: 


Redefined in descendants as:

[ Top ]
commit  [line 620]

  void commit( )

Commit the current transaction.


API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
connect  [line 568]

  int connect( [String $mode = "rw"]  )

Connect to the database.

Parameters:
String   $mode:  The mode to connect

API Tags:
Return:  Connection status
Abstract:  


Redefined in descendants as:

[ Top ]
createDDL  [line 1283]

  atkDDL &createDDL( )

Create an atkDDL object for constructing ddl queries.


API Tags:
Return:  DDL object


Redefined in descendants as:

[ Top ]
createQuery  [line 1198]

  atkQuery &createQuery( )

Create an atkQuery object for constructing queries.


API Tags:
Return:  Query class.


Redefined in descendants as:

[ Top ]
deleteAll  [line 1218]

  void deleteAll( )

Empty all database tables.



Redefined in descendants as:

[ Top ]
disconnect  [line 612]

  void disconnect( )

Disconnect from database


API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
doConnect  [line 588]

  void doConnect( string $host, string $user, string $password, string $database, int $port, string $charset  )

Connect to the database

Parameters:
string   $host:  The host to connect to
string   $user:  The user to connect with
string   $password:  The password to connect with
string   $database:  The database to connect to
int   $port:  The portnumber to use for connecting
string   $charset:  The charset to use

API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
dropAll  [line 1249]

  void dropAll( )

Drop all database tables.



Redefined in descendants as:

[ Top ]
errorLookup  [line 443]

  string errorLookup( integer $errno  )

Looks up the error

Parameters:
integer   $errno:  Error number

API Tags:
Return:  The translation for the error


Redefined in descendants as:

[ Top ]
escapeSQL  [line 1186]

  String escapeSQL( String $string, [Bool $wildcard = false]  )

escapes quotes for use in SQL: ' -> '' (and sometimes % -> %%)

Parameters:
String   $string:  The string to escape
Bool   $wildcard:  Use wildcards?

API Tags:
Return:  The escaped SQL string


Redefined in descendants as:

[ Top ]
func_concat  [line 1103]

  unknown func_concat( array $fields  )

Get CONCAT() equivalent for the current database.

Parameters:
array   $fields: 


Redefined in descendants as:

[ Top ]
func_concat_ws  [line 1119]

  string func_concat_ws( array $fields, string $separator, [boolean $remove_all_spaces = false]  )

Get CONCAT_WS() equivalent for the current database.

Parameters:
array   $fields: 
string   $separator: 
boolean   $remove_all_spaces:  remove all spaces in result (atkAggrecatedColumns searches for string without spaces)


Redefined in descendants as:

[ Top ]
func_datetimetochar  [line 1164]

  String func_datetimetochar( String $fieldname  )

Get TO_CHAR() equivalent for the current database.

TODO/FIXME: add format parameter. Current format is always yyyy-mm-dd hh:mi.

Parameters:
String   $fieldname:  The field to generate the to_char for.

API Tags:
Return:  Piece of sql query that converts a datetime field to char for the current database


Redefined in descendants as:

[ Top ]
func_datetochar  [line 1091]

  String func_datetochar( String $fieldname, [String $format = ""]  )

Get TO_CHAR() equivalent for the current database.

Each database driver should override this method to perform vendor specific conversion.

Parameters:
String   $fieldname:  The field to generate the to_char for.
String   $format:  Format specifier. The format is compatible with php's date() function (http://www.php.net/date) The default is what's specified by $config_date_to_char, or "Y-m-d" if not set in the configuration.

API Tags:
Return:  Piece of sql query that converts a date field to char for the current database


Redefined in descendants as:

[ Top ]
func_now  [line 1060]

  void func_now( )

get NOW() or SYSDATE() equivalent for the current database

Every database has it's own implementation to get the current date



Redefined in descendants as:

[ Top ]
func_substring  [line 1072]

  void func_substring( String $fieldname, [Integer $startat = 0], [Integer $length = 0]  )

get SUBSTRING() equivalent for the current database.

Parameters:
String   $fieldname:  The database fieldname
Integer   $startat:  The position to start from
Integer   $length:  The number of characters


Redefined in descendants as:

[ Top ]
getAtkDbErrno  [line 373]

  int getAtkDbErrno( )

Get generic atk errorccode


API Tags:
Return:  One of the ATK DB_* codes.


Redefined in descendants as:

[ Top ]
getDbErrno  [line 385]

  mixed getDbErrno( )

Get vendor-dependent database error number.

Applications should not rely on this method, if they want to be database independent.


API Tags:
Return:  Database dependent error code.


Redefined in descendants as:

[ Top ]
getDbError  [line 397]

  String getDbError( )

Get vendor-dependent database error message.

Applications should not rely on this method, if they want to be database independent.


API Tags:
Return:  Database dependent error message.


Redefined in descendants as:

[ Top ]
getDbStatus  [line 1429]

  DB_SUCCESS getDbStatus( )

Check if current db is present and acceptable for current user


API Tags:
Return:  if


Redefined in descendants as:

[ Top ]
getErrorMsg  [line 462]

  String getErrorMsg( )

Get localized error message (for display in the application)


API Tags:
Return:  Error message


Redefined in descendants as:

[ Top ]
getErrorType  [line 360]

  String getErrorType( )

Determine whether an error that occurred is a recoverable (user) error or a system error.


API Tags:
Return:  "user" or "system"


Redefined in descendants as:

[ Top ]
getHaltOnError  [line 1409]

  boolean getHaltOnError( )

Halt on error?


API Tags:
Return:  halt on error?
Access:  public


[ Top ]
getQueryId  [line 527]

  mixed getQueryId( )

Returns the current query resource.


API Tags:
Return:  query resource
Access:  public


[ Top ]
getQueryMode  [line 421]

  string getQueryMode( string $query  )

Returns the query mode

Parameters:
string   $query: 

API Tags:
Return:  Return r or w mode


Redefined in descendants as:

[ Top ]
getRow  [line 819]

  array getRow( string $query, [boolean $useLimit = false]  )

Returns the first row for the given query.

Please note: this method does *not* add a limit to the query

Parameters:
string   $query:  query
boolean   $useLimit:  add limit to the query (if you have your own limit specify false!)

API Tags:
Return:  row
Access:  public


[ Top ]
getRows  [line 840]

  array getRows( string $query, [int $offset = -1], [int $limit = -1]  )

Get all rows for the given query.

NOTE: This is not an efficient way to retrieve records, as this will load all records into one array into memory. If you retrieve a lot of records, you might hit the memory_limit and your script will die.

Parameters:
string   $query:  query
int   $offset:  offset
int   $limit:  limit

API Tags:
Return:  rows
Access:  public


[ Top ]
getRowsAssoc  [line 861]

  array getRowsAssoc( string $query, [int|string $keyColumn = 0], [int $offset = -1], [int $limit = -1]  )

Get rows in an associative array with the given column used as key for the rows.

NOTE: This is not an efficient way to retrieve records, as this will load all records into one array into memory. If you retrieve a lot of records, you might hit the memory_limit and your script will die.

Parameters:
string   $query:  query
int|string   $keyColumn:  column index / name (default first column) to be used as key
int   $offset:  offset
int   $limit:  limit

API Tags:
Return:  rows
Access:  public


[ Top ]
getSearchModes  [line 976]

  array getSearchModes( )

This function indicates what searchmodes the database supports.


API Tags:
Return:  with search modes


Redefined in descendants as:

[ Top ]
getType  [line 333]

  String getType( )

Get the database driver type.


API Tags:
Return:  driver type


Redefined in descendants as:

[ Top ]
getValue  [line 897]

  mixed getValue( string $query, [mixed $default = null], [int|string $valueColumn = 0], [boolean $useLimit = false]  )

Get a single value from a certain specified query

Parameters:
string   $query:  query
mixed   $default:  fallback value if the query doesn't return a result
int|string   $valueColumn:  column index / name (default first column) to be used as value
boolean   $useLimit:  add limit to the query (if you have your own limit specify false!)

API Tags:
Return:  first value or default fallback value
Access:  public


Redefined in descendants as:

[ Top ]
getValues  [line 931]

  array getValues( string $query, [int|string $valueColumn = 0], [int $offset = -1], [int $limit = -1]  )

Get an array with all the values in the specified column.

NOTE: This is not an efficient way to retrieve records, as this will load all records into one array into memory. If you retrieve a lot of records, you might hit the memory_limit and your script will die.

Parameters:
string   $query:  query
int|string   $valueColumn:  column index / name (default first column) to be used as value
int   $offset:  offset
int   $limit:  limit

API Tags:
Return:  with values


Redefined in descendants as:

[ Top ]
getValuesAssoc  [line 954]

  array getValuesAssoc( string $query, [int|string $keyColumn = 0], [int|string $valueColumn = 1], [int $offset = -1], [int $limit = -1]  )

Get rows in an associative array with the given key column used as key and the given value column used as value.

NOTE: This is not an efficient way to retrieve records, as this will load all records into one array into memory. If you retrieve a lot of records, you might hit the memory_limit and your script will die.

Parameters:
string   $query:  query
int|string   $keyColumn:  column index / name (default first column) to be used as key
int|string   $valueColumn:  column index / name (default first column) to be used as value
int   $offset:  offset
int   $limit:  limit

API Tags:
Return:  rows
Access:  public


[ Top ]
halt  [line 504]

  void halt( [String $message = ""]  )

If haltonerror is set, this will raise an atkerror. If not, it will place the error in atkdebug and continue.

Parameters:
String   $message: 

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
hasError  [line 350]

  void hasError( )

Has error?



Redefined in descendants as:

[ Top ]
hasMode  [line 1375]

  bool hasMode( string $mode  )

Check if the current instance has the given mode

Parameters:
string   $mode:  The mode we want to check

API Tags:
Return:  True or False
Access:  public


Redefined in descendants as:

[ Top ]
init  [line 1349]

  atkDb init( [String $connectionname = 'default'], [String $mode = 'r']  )

(Re)Initialise a database driver with a connection

Parameters:
String   $connectionname:  The connectionname
String   $mode:  The mode to connect with

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
link_id  [line 342]

  Connection link_id( )

Get the current connection.


API Tags:
Return:  resource id


Redefined in descendants as:

[ Top ]
lock  [line 711]

  boolean lock( String $table, [String $mode = "write"]  )

Lock a table in the database.

Parameters:
String   $table:  The name of the table to lock.
String   $mode:  The lock type.

API Tags:
Return:  True if succesful, false if not.
Abstract:  


Redefined in descendants as:

[ Top ]
maxIdentifierLength  [line 1174]

  Integer maxIdentifierLength( )

Returns the maximum length an identifier (tablename, columnname, etc) may have


API Tags:
Return:  The maximum identifier length


Redefined in descendants as:

[ Top ]
metadata  [line 781]

  array metadata( string $table, [bool $full = false]  )

Return the meta data of a certain table HIE GEBLEVEN

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" The last one is used, if you have a field name, but no index.

Parameters:
string   $table:  the table name
bool   $full:  all meta data or not

API Tags:
Return:  with meta data


Redefined in descendants as:

[ Top ]
nextid  [line 750]

  int nextid( string $sequence  )

Get the next sequence number of a certain sequence.

If the sequence does not exist, it is created automatically.

Parameters:
string   $sequence:  The sequence name

API Tags:
Return:  The next sequence value
Abstract:  


Redefined in descendants as:

[ Top ]
next_record  [line 698]

  mixed next_record( )

Retrieve the next record in the resultset.


API Tags:
Return:  An array containing the record, or 0 if there are no more records to retrieve.
Abstract:  


Redefined in descendants as:

[ Top ]
prepare  [line 655]

  atkStatement prepare( string $query  )

Creates a new statement for the given query.

Parameters:
string   $query:  SQL query

API Tags:
Return:  statement
See:  atkStatement
Access:  public


[ Top ]
query  [line 687]

  void query( String $query, [int $offset = -1], [int $limit = -1]  )

Parse and execute a query.

If the query is a select query, the rows can be retrieved using the next_record() method.

Parameters:
String   $query:  The SQL query to execute
int   $offset:  Retrieve the results starting at the specified record number. Pass -1 or 0 to start at the first record.
int   $limit:  Indicates how many rows to retrieve. Pass -1 to retrieve all rows.

API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
query_id  [line 556]

  Resource query_id( )

Get the current query statement resource id.


API Tags:
Return:  Query statement resource id.


Redefined in descendants as:

[ Top ]
quoteIdentifier  [line 1458]

  string quoteIdentifier( string $str  )

Quote Indentifier

Parameters:
string   $str: 


Redefined in descendants as:

[ Top ]
resetQueryId  [line 547]

  void resetQueryId( )

Rests the query resource.

NOTE: this doesn't close the query/statement!


API Tags:
Access:  public


[ Top ]
rollback  [line 642]

  void rollback( [string $savepoint = ""]  )

Rollback the current transaction.

(If a savepoint is given to the given savepoint.)

Parameters:
string   $savepoint:  savepoint name

API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
savepoint  [line 630]

  void savepoint( string $name  )

Set savepoint with the given name.

Parameters:
string   $name:  savepoint name

API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
setHaltOnError  [line 1419]

  void setHaltOnError( [Bool $state = true]  )

Halt on error or not?

Parameters:
Bool   $state: 


Redefined in descendants as:

[ Top ]
setInstance  [line 1392]

  void &setInstance( string $name, &$db, object $db  )

Replace the current instance of a named connection at runtime with a different connection. This is useful for example for replacing a named database instance with a mock object for testing purposes.

Parameters:
string   $name: 
object   $db: 
   &$db: 


Redefined in descendants as:

[ Top ]
setQueryId  [line 537]

  void setQueryId( mixed $queryId  )

Sets the current query identifier used for next_record() etc.

Parameters:
mixed   $queryId:  query resource

API Tags:
Access:  public


[ Top ]
setSequenceValue  [line 258]

  void setSequenceValue( string $seqname, int $value  )

Set database sequence value.

Parameters:
string   $seqname:  sequence name
int   $value:  sequence value

API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
setUserError  [line 409]

  void setUserError( mixed $errno  )

Define custom user error codes.

Error codes passed to this method will be treated as recoverable user errors.

Parameters:
mixed   $errno:  Vendor-dependent database error code


Redefined in descendants as:

[ Top ]
tableExists  [line 804]

  bool tableExists( string $tableName  )

This function checks the database for a table with the provide name

Parameters:
string   $tableName:  the table to find

API Tags:
Return:  true if found, false if not found


Redefined in descendants as:

[ Top ]
tableMeta  [line 990]

  array tableMeta( string $table  )

Fetches table meta data from database

Parameters:
string   $table: 

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
table_names  [line 792]

  array table_names( [boolean $includeViews = true]  )

Return the available table names

Parameters:
boolean   $includeViews:  include views?

API Tags:
Return:  with table names etc.


Redefined in descendants as:

[ Top ]
toggleForeignKeys  [line 1210]

  void toggleForeignKeys( boolean $enable  )

Enable/disable all foreign key constraints.

Parameters:
boolean   $enable:  enable/disable foreign keys?


Redefined in descendants as:

[ Top ]
unlock  [line 722]

  boolean unlock( )

Relieve all locks.


API Tags:
Return:  True if succesful, false if not.
Abstract:  


Redefined in descendants as:

[ Top ]
vendorDateFormat  [line 1147]

  String vendorDateFormat( String $format  )

Convert a php date() format specifier to a vendor specific format specifier.

The default implementation returns the format as used by many database vendors ('YYYYMMDD HH24:MI'). Databases that use different formatting, should override this method.

Note that currently, only the common specifiers Y, m, d, H, h, i and s are supported.

Parameters:
String   $format:  Format specifier. The format is compatible with php's date() function (http://www.php.net/date)

API Tags:
Return:  Vendor specific format specifier.


Redefined in descendants as:

[ Top ]
_getTableMetaFromCache  [line 1016]

  array _getTableMetaFromCache( string $table  )

If cached it'll return the table metadata from cache.

Parameters:
string   $table: 

API Tags:
Access:  private


[ Top ]
_getTableMetaFromDb  [line 1040]

  array _getTableMetaFromDb( string $table  )

Returns the tablemetadata directly from db

Parameters:
string   $table: 

API Tags:
Access:  protected


[ Top ]
_translateError  [line 603]

  int _translateError( mixed $errno  )

Translate database-vendor dependent error messages into an ATK generic error code.

Derived classes should implement this method and translate their error codes.

Parameters:
mixed   $errno:  Vendor-dependent error code.

API Tags:
Return:  ATK error code
Access:  private


Redefined in descendants as:

[ Top ]
Home | About | Contact