DboSource Class Info:
- Class Declaration:
- class DboSource extends DataSource
- File name:
- cake/libs/model/datasources/dbo_source.php
- Summary:
- DboSource Creates DBO-descendant objects from a given db connection configuration
- Class Inheritance
- package
- cake
- subpackage
- cake.cake.libs.model.datasources
Properties:
Show/Hide parent properties
| public | affected | String to hold how many rows were affected by the last SQL operation. |
| public | alias | Database keyword used to assign aliases to identifiers. |
| protected | _baseConfig | The default configuration of a specific DataSource |
| public | __bypass | Bypass automatic adding of joined fields/associations. |
| public | cacheSources | Whether or not source data like available tables and schema descriptions should be cached |
| protected | _commands | Index of basic SQL commands |
| public | config | The DataSource configuration |
| public | configKeyName | The DataSource configuration key name |
| public | connected | Are we connected to the DataSource? |
| public | connection | A reference to the physical connection of this DataSource |
| public | description | Description string for this Database Data Source. |
| public | endQuote | The ending character that this DataSource uses for quoted identifiers. |
| public | error | Error description of last query |
| public | fieldCache | Caches fields quoted in DboSource::name() |
| public | fullDebug | Print full query debug info? |
| public | index | index definition, standard cake, primary, index, unique |
| protected | _log | Log object |
| public | numRows | Number of rows in current resultset |
| protected | _queriesCnt | Queries count. |
| protected | _queriesLog | Log of queries executed by this DataSource |
| protected | _queriesLogMax | Maximum number of items in query log, to prevent query log taking over too much memory on large amounts of queries -- I we've had problems at >6000 queries on one system. |
| protected | _queriesTime | Total duration of all queries. |
| protected | _queryCache | Caches serialzed results of executed queries |
| protected | _result | Enter description here... |
| protected | _sources | Holds a list of sources (tables) contained in the DataSource |
| public | __sqlOps | The set of valid SQL operations usable in a WHERE statement |
| public | startQuote | The starting character that this DataSource uses for quoted identifiers. |
| public | took | Time the last query took |
| protected | _transactionStarted | Whether or not this DataSource is in the middle of a transaction |
Method Summary:
Show/Hide parent methods
alterSchema
topGenerate a alter syntax from CakeSchema::compare()
- Parameters:
-
$compare required (no default) $table optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2292
- return
- unknown
begin
topBegin a transaction
(i.e. if the database/model does not support transactions,
or a transaction has not started).
- Parameters:
-
$model model required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1566
- return
- boolean True on success, false on fail
boolean
topTranslates between PHP boolean values and Database (faked) boolean values
- Parameters:
-
$data mixed Value to be translated required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2201
- return
- mixed Converted boolean value
buildColumn
topGenerate a database-native column schema string
- Parameters:
-
$column array An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]), where options can be 'default', 'length', or 'key'. required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2324
- return
- string
buildIndex
topFormat indexes for create table
- Parameters:
-
$indexes array required (no default) $table string optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2380
- return
- array
buildJoinStatement
topBuilds and generates a JOIN statement from an array. Handles final clean-up before conversion.
- Parameters:
-
$join array An array defining a JOIN statement in a query required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1236
- return
- string An SQL JOIN statement to be used in a query
- see
- DboSource::renderJoinStatement()
- DboSource::buildStatement()
buildStatement
topBuilds and generates an SQL statement from an array. Handles final clean-up before conversion.
- Parameters:
-
$query array An array defining an SQL query required (no default) $model object The model object which initiated the query required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1260
- return
- string An executable SQL statement
- see
- DboSource::renderStatement()
__cacheDescription
topCache the DataSource description
- Parameters:
-
$object string The name of the object (model) to cache required (no default) $data mixed The description of the model, usually a string or array optional NULL - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 387
cakeError
topUsed to report user friendly errors.
If there is a file app/error.php or app/app_error.php this file will be loaded
error.php is the AppError class it should extend ErrorHandler class.
- Parameters:
-
$method string Method to be called in the error class (AppError or ErrorHandler classes) required (no default) $messages array Message that is to be displayed by the error class optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 189
- return
- error message
- access
- public
calculate
topReturns an SQL calculation, i.e. COUNT() or MAX()
- Parameters:
-
$model model required (no default) $func string Lowercase name of SQL function, i.e. 'count' or 'max' required (no default) $params array Function parameters (any values must be quoted manually) optional array ( ) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1526
- return
- string An SQL calculation function
- access
- public
close
topDisconnects database, kills the connection and says the connection is closed,
and if DEBUG is turned on, the log for this object is shown.
- Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2109
column
topConverts column types to basic types
- Parameters:
-
$real string Real column type (i.e. "varchar(255)") required (no default) - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 286
- return
- string Abstract column type (i.e. "string")
commit
topCommit a transaction
(i.e. if the database/model does not support transactions,
or a transaction has not started).
- Parameters:
-
$model model required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1581
- return
- boolean True on success, false on fail
conditionKeysToString
topCreates a WHERE clause by parsing given conditions array. Used by DboSource::conditions().
- Parameters:
-
$conditions array Array or string of conditions required (no default) $quoteValues boolean If true, values should be quoted optional true $model Model A reference to the Model instance making the query optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1784
- return
- string SQL fragment
conditions
topCreates a WHERE clause by parsing given conditions data.
- Parameters:
-
$conditions mixed Array or string of conditions required (no default) $quoteValues boolean If true, values should be quoted optional true $where boolean If true, "WHERE " will be prepended to the return value optional true $model Model A reference to the Model instance making the query optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1745
- return
- string SQL fragment
__construct
topConstructor
- Parameters:
-
$config optional NULL $autoConnect optional true - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 88
create
topThe "C" in CRUD
- Parameters:
-
$model Model required (no default) $fields array optional NULL $values array optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 559
- return
- boolean Success
createSchema
topGenerate a database-native schema for the given Schema object
- Parameters:
-
$schema object An instance of a subclass of CakeSchema required (no default) $tableName string Optional. If specified only the table name given will be generated. Otherwise, all tables defined in the schema are generated. optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2246
- return
- string
defaultConditions
topCreates a default set of conditions from the model if $conditions is null/empty.
- Parameters:
-
$model object required (no default) $conditions mixed required (no default) $useAlias boolean Use model aliases rather than table names when generating conditions optional true - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1611
- return
- mixed
delete
topGenerates and executes an SQL DELETE statement.
For databases that do not support aliases in UPDATE queries.
- Parameters:
-
$model Model required (no default) $conditions mixed optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1447
- return
- boolean Success
describe
topReturns a Model description (metadata) or null if none found.
- Parameters:
-
$model Model required (no default) - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 240
- return
- mixed
__destruct
topCloses the current datasource.
- Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 500
dispatchMethod
topCalls a method on this object with the given parameters. Provides an OO wrapper
for call_user_func_array, and improves performance by using straight method calls
in most cases.
- Parameters:
-
$method string Name of the method to call required (no default) $params array Parameter list to use when calling $method optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 113
- return
- mixed Returns the result of the method call
- access
- public
dropSchema
topGenerate a "drop table" statement for the given Schema object
- Parameters:
-
$schema object An instance of a subclass of CakeSchema required (no default) $table string Optional. If specified only the table name given will be generated. Otherwise, all tables defined in the schema are generated. optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2303
- return
- string
execute
topQueries the database with given SQL statement, and obtains some metadata about the result
(rows affected, timing, any errors, number of rows in resultset). The query is also logged.
If DEBUG is set, the log is shown all the time, else it is only shown on errors.
- Parameters:
-
$sql string required (no default) $options array optional array ( ) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 183
- return
- mixed Resource or object representing the result set, or false on failure
expression
topReturns an object to represent a database expression in a query
- Parameters:
-
$expression string required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 158
- return
- object An object representing a database expression to be used in a query
fetchAll
topReturns an array of all result rows for a given SQL query.
Returns false if no rows matched.
- Parameters:
-
$sql string SQL statement required (no default) $cache boolean Enables returning/storing cached query results optional true $modelName optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 329
- return
- array Array of resultset rows, or false if no rows matched
fetchAssociated
topA more efficient way to fetch associations. Woohoo!
- Parameters:
-
$model model Primary model object required (no default) $query string Association query required (no default) $ids array Array of IDs of associated records required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 894
- return
- array Association results
fetchRow
topReturns a row from current resultset as an array
- Parameters:
-
$sql optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 306
- return
- array The fetched row as an array
field
topReturns a single field of the first of query results for a given SQL query, or false if empty.
- Parameters:
-
$name string Name of the field required (no default) $sql string SQL query required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 365
- return
- unknown
fields
topGenerates the fields list of an SQL query.
- Parameters:
-
$model Model required (no default) $alias string Alias tablename optional NULL $fields mixed Alias tablename optional array ( ) $quote boolean If false, returns fields array unquoted optional true - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1665
- return
- array
__filterResults
topPrivate method. Passes association results thru afterFind filters of corresponding model
- Parameters:
-
$results array Reference of resultset to be filtered required (no default) $model object Instance of model to operate against required (no default) $filtered array List of classes already filtered, to be skipped optional array ( ) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 699
- return
- return
fullTableName
topGets full table name including prefix
- Parameters:
-
$model mixed required (no default) $quote boolean optional true - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 538
- return
- string Full quoted table name
generateAssociationQuery
topGenerates an array representing a query or part of a query from a single model or two associated models
- Parameters:
-
$model Model required (no default) $linkModel Model required (no default) $type string required (no default) $association string required (no default) $assocData array required (no default) $queryData array required (no default) $external boolean required (no default) $resultSet array required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1032
- return
- mixed
getConstraint
topReturns a conditions array for the constraint between two models
- Parameters:
-
$type string Association type required (no default) $model object Model object required (no default) $linkModel required (no default) $alias required (no default) $assoc required (no default) $alias2 optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1196
- return
- array Conditions array defining the constraint between $model and $association
_getJoins
topReturns an array of SQL JOIN fragments from a model's associations
- Parameters:
-
$model object required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1497
- return
- array
group
topCreate a GROUP BY SQL clause
- Parameters:
-
$group string Group By Condition required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2095
- return
- mixed string condition or null
hasAny
topChecks if the specified table contains any record matching specified SQL
- Parameters:
-
$Model required (no default) $sql string SQL WHERE clause (condition only, not the "WHERE" part) required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2122
- return
- boolean True if the table has a matching record, else false
hasResult
topChecks if the result is valid
- Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 452
- return
- boolean True if the result is valid else false
identifier
topReturns an object to represent a database identifier in a query
- Parameters:
-
$identifier string required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 146
- return
- object An object representing a database identifier to be used in a query
index
topReturns an array of the indexes in given datasource name.
- Parameters:
-
$model string Name of model to inspect required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2235
- return
- array Fields in table. Keys are column and unique
insertMulti
topInserts multiple values into a table
- Parameters:
-
$table string required (no default) $fields string required (no default) $values array required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2219
- access
- protected
insertQueryData
topEnter description here...
- Parameters:
-
$query unknown_type required (no default) $data unknown_type required (no default) $association unknown_type required (no default) $assocData unknown_type required (no default) $model Model required (no default) $linkModel Model required (no default) $stack array required (no default) - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 418
- return
- unknown
introspectType
topGuesses the data type of an array
- Parameters:
-
$value string required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2409
- return
- void
- access
- public
isConnected
topChecks if it's connected to the database
- Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 444
- return
- boolean True if the database is connected, else false
isInterfaceSupported
topReturns true if the DataSource supports the given interface (method)
- Parameters:
-
$interface string The name of the interface (method) required (no default) - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 365
- return
- boolean True on success
lastAffected
topReturns the ID generated from the previous INSERT operation.
- Parameters:
-
$source unknown_type optional NULL - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 356
- return
- in
lastInsertId
topReturns the ID generated from the previous INSERT operation.
- Parameters:
-
$source unknown_type optional NULL - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 338
- return
- in
lastNumRows
topReturns the ID generated from the previous INSERT operation.
- Parameters:
-
$source unknown_type optional NULL - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 347
- return
- in
length
topGets the length of a database-native column description, or null if no length
- Parameters:
-
$real string Real database-layer column type (i.e. "varchar(255)") required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2142
- return
- mixed An integer or string representing the length of the column
limit
topReturns a limit statement in the correct format for the particular database.
- Parameters:
-
$limit integer Limit of results returned required (no default) $offset integer Offset from which to start results optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2005
- return
- string SQL limit/offset statement
listSources
topCaches/returns cached results for child instances
- Parameters:
-
$data optional NULL - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 202
- return
- array
log
topAPI for logging events.
- Parameters:
-
$msg string Log message required (no default) $type integer Error type constant. Defined in app/config/core.php. optional 2 - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 150
- return
- boolean Success of log write
- access
- public
logQuery
topLog given SQL query.
- Parameters:
-
$sql string SQL statement required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 493
- todo
- : Add hook to log errors instead of returning false
_matchRecords
topGets a list of record IDs for the given conditions. Used for multi-record updates and deletes
in databases that do not support aliases in UPDATE/DELETE queries.
- Parameters:
-
$model Model required (no default) $conditions mixed optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1471
- return
- array List of record IDs
- access
- protected
__mergeAssociation
topEnter description here...
- Parameters:
-
$data unknown_type required (no default) $merge unknown_type required (no default) $association unknown_type required (no default) $type unknown_type required (no default) $selfJoin boolean optional false - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 950
__mergeConditions
topMerges a mixed set of string/array conditions
- Parameters:
-
$query required (no default) $assoc required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1341
- return
- array
__mergeHasMany
topmergeHasMany - Merge the results of hasMany relations.
- Parameters:
-
$resultSet array Data to merge into required (no default) $merge array Data to merge required (no default) $association string Name of Model being Merged required (no default) $model object Model being merged onto required (no default) $linkModel object Model being merged required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 913
- return
- void
name
topReturns a quoted name of $data for use in an SQL statement.
Strips fields out of SQL functions before quoting.
- Parameters:
-
$data string required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 381
- return
- string SQL field
Object
topA hack to support __construct() on PHP 4
Hint: descendant classes have no PHP4 class_name() constructors,
so this constructor gets called first and calls the top-layer __construct()
which (if present) should call parent::__construct()
- Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 53
- return
- Object
order
topReturns an ORDER BY clause as a string.
- Parameters:
-
$keys required (no default) $direction string Direction (ASC or DESC) optional 'ASC' - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 2028
- return
- string ORDER BY clause
_persist
topChecks for a persistent class file, if found file is opened and true returned
If file is not found a file is created and false returned
If used in other locations of the model you should choose a unique name for the persistent file
There are many uses for this method, see manual for examples
- Parameters:
-
$name string name of the class to persist required (no default) $return required (no default) $object string the object to persist required (no default) $type optional NULL - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 219
- return
- boolean Success
- access
- protected
- todo
- add examples to manual
_prepareUpdateFields
topQuotes and prepares fields and values for an SQL UPDATE statement
- Parameters:
-
$model Model required (no default) $fields array required (no default) $quoteValues boolean If values should be quoted, or treated as SQL snippets optional true $alias boolean Include the model alias in the field name optional false - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1405
- return
- array Fields and values, quoted and preparted
- access
- protected
query
topDataSource Query abstraction
- Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 211
- return
- resource Result resource identifier
queryAssociation
topEnter description here...
- Parameters:
-
$model Model required (no default) $linkModel unknown_type required (no default) $type string Association type required (no default) $association unknown_type Association type required (no default) $assocData unknown_type Association type required (no default) $queryData unknown_type Association type required (no default) $external unknown_type Association type required (no default) $resultSet unknown_type Association type required (no default) $recursive integer Number of levels of association required (no default) $stack array Number of levels of association required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 741
rawQuery
topExecutes given SQL statement.
- Parameters:
-
$sql string SQL statement required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 170
- return
- unknown
read
topThe "R" in CRUD
- Parameters:
-
$model Model required (no default) $queryData array optional array ( ) $recursive integer Number of levels of association optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 604
- return
- unknown
reconnect
topReconnects to database server with optional new settings
- Parameters:
-
$config array An array defining the new configuration settings optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 107
- return
- boolean True on success, false on failure
renderJoinStatement
topRenders a final SQL JOIN statement
- Parameters:
-
$data array required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1287
- return
- string
renderStatement
topRenders a final SQL statement by putting together the component parts in the correct order
- Parameters:
-
$type string required (no default) $data array required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1298
- return
- string
requestAction
topCalls a controller's method from any location.
- Parameters:
-
$url mixed String or array-based url. required (no default) $extra array if array includes the key "return" it sets the AutoRender to true. optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 86
- return
- mixed Boolean true or false on success/failure, or contents of rendered action if 'return' is set in $extra.
- access
- public
resolveKey
topReturns a key formatted like a string Model.fieldname(i.e. Post.title, or Country.name)
- Parameters:
-
$model unknown_type required (no default) $key unknown_type required (no default) $assoc unknown_type optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1633
- return
- string
rollback
topRollback a transaction
(i.e. if the database/model does not support transactions,
or a transaction has not started).
- Parameters:
-
$model model required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1596
- return
- boolean True on success, false on fail
_savePersistent
topYou should choose a unique name for the persistent file
There are many uses for this method, see manual for examples
- Parameters:
-
$name string name used for object to cache required (no default) $object object the object to persist required (no default) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 247
- return
- boolean true on save, throws error if file can not be created
- access
- protected
__scrubQueryData
topPrivate helper method to remove query metadata in given data array.
- Parameters:
-
$data array required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1648
- return
- array
_set
topAllows setting of multiple properties of the object in a single line of code.
- Parameters:
-
$properties array An associative array containing properties and corresponding values. optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 169
- return
- void
- access
- protected
setConfig
topSets the configuration for the DataSource
- Parameters:
-
$config array The configuration array optional array ( ) - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 378
- return
- void
showLog
topOutputs the contents of the queries log.
- Parameters:
-
$sorted boolean optional false - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 460
showQuery
topOutput information about an SQL query. The SQL statement, number of rows in resultset,
and execution time in microseconds. If the query fails, an error is output instead.
- Parameters:
-
$sql string Query to show information on. required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 516
sources
topConvenience method for DboSource::listSources(). Returns source names in lowercase.
- Parameters:
-
$reset optional false - Method defined in class:
- DataSource
- Method defined in file:
- cake/libs/model/datasources/datasource.php on line 228
- return
- array
_stop
topStop execution of the current script
- Parameters:
-
$status optional 0 - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 139
- return
- void
- access
- public
toString
topObject-to-string conversion.
Each class can override this method as necessary.
- Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 73
- return
- string The name of this class
- access
- public
truncate
topDeletes all the records in a table and resets the count of the auto-incrementing
primary key, where applicable.
- Parameters:
-
$table mixed A string or model class representing the table to be truncated required (no default) - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1555
- return
- boolean SQL TRUNCATE TABLE statement, false if not applicable.
- access
- public
update
topGenerates and executes an SQL UPDATE statement for given model, fields, and values.
For databases that do not support aliases in UPDATE queries.
- Parameters:
-
$model Model required (no default) $fields array optional array ( ) $values array optional NULL $conditions mixed optional NULL - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 1372
- return
- boolean Success
value
topPrepares a value, or an array of values for database queries by quoting and escaping them.
- Parameters:
-
$data mixed A value or an array of values to prepare. required (no default) $column string The column into which this data will be inserted optional NULL $read boolean Value to be used in READ or WRITE context optional true - Method defined in class:
- DboSource
- Method defined in file:
- cake/libs/model/datasources/dbo_source.php on line 122
- return
- mixed Prepared value or array of values.