clearFusionCMS 3.0.0
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • clearFusionCMS
    • module
      • cloudflare
      • comments
      • content
      • forms
      • members
      • search
  • fusionLib
  • None

Classes

  • _flFormGroup
  • _flUtf8Base
  • flAcMgr
  • flApiDbInstaller
  • flApiKeyMgr
  • flApiServer
  • flApiService
  • flApp
  • flAuthTOTP
  • flBufferCode
  • flBufferCss
  • flBufferJs
  • flCache
  • flCacheAPC
  • flCacheDb
  • flCacheDbInstaller
  • flCacheDummy
  • flCacheFile
  • flCacheFunction
  • flCacheMemcache
  • flCacheMemcached
  • flCacheOutput
  • flCacheRedis
  • flCacheSqlite
  • flConfig
  • flConfigDb
  • flConfigDbInstaller
  • flConfigFile
  • flConfigIni
  • flController
  • flControllerAction
  • flDate
  • flDateTzMenu
  • flDb
  • flDbInstaller
  • flDbInstallerInterface
  • flDbMySQL
  • flDbMySQLi
  • flDbMySQLiResult
  • flDbMySQLResult
  • flDbNestedSet
  • flDbResult
  • flDbSQLite
  • flDbSQLite3
  • flDbSQLite3Result
  • flDbSQLiteResult
  • flEmail
  • flEvent
  • flEventDbInstaller
  • flEventManager
  • flExceptionErrorController
  • flExceptionReporter
  • flForm
  • flFormBuilder
  • flFormDecorator
  • flFormDecoratorDl
  • flFormDecoratorDtDd
  • flFormDecoratorFieldset
  • flFormDecoratorForm
  • flFormDecoratorLi
  • flFormDecoratorList
  • flFormDecoratorUl
  • flFormElement
  • flFormElementButton
  • flFormElementCheckbox
  • flFormElementChecklist
  • flFormElementEmail
  • flFormElementFile
  • flFormElementHidden
  • flFormElementImage
  • flFormElementInteger
  • flFormElementNumber
  • flFormElementPane
  • flFormElementPassword
  • flFormElementRadio
  • flFormElementRecaptcha
  • flFormElementSearch
  • flFormElementSelect
  • flFormElementSubmit
  • flFormElementText
  • flFormElementTextArea
  • flFormElementTextSuggest
  • flFormElementUri
  • flFormElementWYSIWYG
  • flFormValidator
  • flFormValidatorAttribMax
  • flFormValidatorAttribMin
  • flFormValidatorCustomJS
  • flFormValidatorEmail
  • flFormValidatorEquals
  • flFormValidatorInteger
  • flFormValidatorMax
  • flFormValidatorMaxChecklist
  • flFormValidatorMaxLength
  • flFormValidatorMin
  • flFormValidatorMinChecklist
  • flFormValidatorMinLength
  • flFormValidatorMultiEmail
  • flFormValidatorNotEquals
  • flFormValidatorNumber
  • flFormValidatorRegex
  • flFormValidatorRequired
  • flFormValidatorSameAs
  • flFormValidatorUri
  • flFtpClient
  • flGravatar
  • flHttpClient
  • flHttpClientCookie
  • flImage
  • flImageFilter
  • flImageFilterBrightness
  • flImageFilterColorize
  • flImageFilterContrast
  • flImageFilterEdgeDetect
  • flImageFilterEmboss
  • flImageFilterGaussianBlur
  • flImageFilterGrayscale
  • flImageFilterMeanRemoval
  • flImageFilterNegative
  • flImageFilterPixelate
  • flImageFilterSelectiveBlur
  • flImageFilterSepia
  • flImageFilterSepia2
  • flImageFilterSmooth
  • flIntegrity
  • flKeygen
  • flLog
  • flLogHandlerChrome
  • flLogHandlerLoggly
  • flLogHandlerPapertrail
  • flLogHandlerSlack
  • flMimeTypes
  • flModuleDbInstaller
  • flModuleMgr
  • flRegistry
  • flRequest
  • flRequestDbInstaller
  • flRequestThrottle
  • flResponse
  • flRouter
  • flRouterRoute
  • flRssChannel
  • flRssClient
  • flRssItem
  • flSearch
  • flSearchIndexer
  • flSearchManager
  • flSearchResults
  • flSearchTags
  • flSession
  • flSessionData
  • flSessionDb
  • flSessionDbInstaller
  • flSessionFile
  • flSessionMemcache
  • flSessionMemcached
  • flSessionRedis
  • flTemplateDbInstaller
  • flTemplateEngine
  • flTemplateManager
  • flTextHTML
  • flTextSplitWords
  • flTextStemmer
  • flTextStemmerEn
  • flTextStrip
  • flTimer
  • flUri
  • flUser
  • flUserAdapter
  • flUserAdapterRemote
  • flUserDbInstaller
  • flUserMgr
  • flUserPwdGen
  • flUserServerApiV1
  • flUtf8
  • flUuid
  • flVariables
  • flVariablesDbInstaller
  • flWidgetBreadcrumb
  • flWidgetFloatingActionMenu
  • flWidgetPagination
  • flWidgetTable
  • flWidgetTabs
  • flWidgetToolbar
  • flWidgetTreeChildNode
  • flWidgetTreeLinkNode
  • flWidgetTreeNode
  • flWidgetTreeView
  • fusionLib

Interfaces

  • flFormElementWYSIWYGCodeInterface
  • flFormElementWYSIWYGInterface
  • flFormElementWYSIWYGTransformInterface
  • flLogHandler
  • flModuleInstallInterface

Exceptions

  • flAcException
  • flAppException
  • flCacheException
  • flConfigException
  • flDateException
  • flDbException
  • flEventException
  • flException
  • flExceptionBadRequest
  • flExceptionForbidden
  • flExceptionLoadClass
  • flExceptionNotFound
  • flExceptionPHP
  • flFormException
  • flHttpClientException
  • flImageException
  • flRegistryException
  • flRequestThrottleException
  • flRouterException
  • flSessionException
  • flTemplateEngineException
  • flUserException
  • flVariablesException
  • flWidgetException

Functions

  • __
  • __noop
  • _flErrorHandler
  • _n
  • _n_noop

Class flDb

flDb Class

Base class for database interface allowing different databases to be accessed in the same way as well as providing functions to simplify use.

Direct known subclasses

flDbMySQL, flDbMySQLi, flDbSQLite, flDbSQLite3

Abstract
Package: fusionLib
Copyright: Copyright (c) 2007 - 2016 fusionLib. All rights reserved.
Located at system/libs/Db/flDb.php

Methods summary

public static flDb
# connect( string $master, string $slave = null )

Create an instance of the appropriate database driver object and connect to the database.

Create an instance of the appropriate database driver object and connect to the database.

The database names are given in DSN format, driver://username:password@host:port/database

Where: port is optional driver is one of mysql, mysqli, sqlite, sqlite3

Parameters

$master
The DSN for the master database.
$slave

The DSN for the slave database if any or null, if the driver doesn't support master/slave then this parameter is ignored. The driver is ignored as it is assumed to be the same as the master.

Returns

flDb
The instance of the database driver object.

Throws

flDbException
public integer
# getQueryCount( )

Get the number of queries.

Get the number of queries.

Returns

integer
The number of queries.
public mixed
# escape( mixed $value )

Escape a value.

Escape a value.

Parameters

$value
The value to escape.

Returns

mixed
The escaped value.
public flDbResult
# query( string $query, array $params = array() )

Perform a query on the database.

Perform a query on the database.

? in the query string is replaced with the escaped quoted parameter

Parameters

$query
The query string.
$params
The array of parameters to use or 1st argument

Returns

flDbResult
The result object or boolean result.

Throws

flDbException
public array
# fetchAll( string $query, array $params = array() )

Fetch an array of all rows.

Fetch an array of all rows.

Parameters

$query
The query string.
$params
The array of parameters to use or 1st argument

Returns

array
Array of rows of false on error.
public array
# fetchRow( string $query, array $params = array() )

Perform a query and return the 1st row.

Perform a query and return the 1st row.

? in the query string is replaced with the escaped quoted parameter

Parameters

$query
The query string.
$params
The array of parameters to use or 1st argument

Returns

array
The row or false.
public mixed
# fetchOne( string $query, array $params = array() )

Perform a query and return the first element of the 1st row.

Perform a query and return the first element of the 1st row.

? in the query string is replaced with the escaped quoted parameter

Parameters

$query
The query string.
$params
The array of parameters to use or 1st argument

Returns

mixed
The item or false.
public array
# maintain( boolean $repair = false )

Optimize or repair tables within the database.

Optimize or repair tables within the database.

Parameters

$repair
true to perform a repair or false to optimize.

Returns

array
Results for each table.
public boolean
# insert( string $table, array $values )

Insert the given value pairs of key values into the table.

Insert the given value pairs of key values into the table.

Parameters

$table
The table to insert the values into.
$values
The array of key value pairs of data to insert.

Returns

boolean
true if worked; else false.
public boolean
# replace( string $table, array $values )

Replace or insert the given key value pairs in the table.

Replace or insert the given key value pairs in the table.

Parameters

$table
The table to replace/insert the values into.
$values
The array of key value pairs of data to insert.

Returns

boolean
true if worked; else false.
public boolean
# update( string $table, array $values, string $where, array $params )

Update a row in the table.

Update a row in the table.

Parameters

$table
The table to update.
$values
The array of key/value pairs of data to update.
$where
The WHERE clause for selecting the row.
$params
The array of parameters to use or 1st argument for use in the WHERE clause.

Returns

boolean
true if worked; else false.
public boolean
# delete( string $table, string $where, array $params )

Delete a table from the database.

Delete a table from the database.

Parameters

$table
The table to delete.
$where
The where clause.
$params
Array of parameters to use in the where clause or 1st argument.

Returns

boolean
true if deleted; else false.
public string
# lastQuery( )

Get the last query string.

Get the last query string.

Returns

string
The last query string.
abstract public mixed
# _escape( mixed $value )

Escape a value in the driver.

Escape a value in the driver.

Parameters

$value
The value to escape.

Returns

mixed
The escaped value.
abstract public flDbResult
# _query( string $query )

Perform the SQL query in the driver.

Perform the SQL query in the driver.

Parameters

$query
The query string.

Returns

flDbResult
The result object or boolean result.
abstract public integer
# insertID( )

Return the id generated by the last insert operation.

Return the id generated by the last insert operation.

Returns

integer
The id.
abstract public integer
# affectedRows( )

Get the number of rows affected by the previous operation.

Get the number of rows affected by the previous operation.

Returns

integer
The number of rows affected.
abstract public array
# fetchTables( )

Get the list of tables in the database.

Get the list of tables in the database.

Returns

array
The list of tables in the database.
abstract public array
# fetchFields( string $table )

Get the names of all fields in a table.

Get the names of all fields in a table.

Parameters

$table
The table to query.

Returns

array
An array holding the names of all fields.
abstract public string
# _maintain( boolean $repair, string $table )

Optimize or repair tables within the database.

Optimize or repair tables within the database.

Parameters

$repair
true to perform a repair or false to optimize.
$table
The name of the table to operate on.

Returns

string
The result.
abstract public string
# errorString( )

The error for the previous operation.

The error for the previous operation.

Returns

string
The error string.
abstract public string
# version( )

The database server version.

The database server version.

Returns

string
The version string.

Properties summary

protected integer $queryCount

The number of queries.

The number of queries.

# 0
protected string $lastQuery

The last query string.

The last query string.

# ''
clearFusionCMS 3.0.0 API documentation generated by ApiGen