Returns

Creates a WHERE clause by parsing given conditions data. If an array or string
conditions are provided those conditions will be parsed and quoted. If a boolean
is given it will be integer cast as condition. Null will return 1 = 1.

Results of this method are stored in a memory cache. This improves performance, but
because the method uses a hashing algorithm it can have collisions.
Setting DboSource::$cacheMethods to false will disable the memory cache.

Returns

Creates a default set of conditions from the model if $conditions is null/empty.
If conditions are supplied then they will be returned. If a model doesn't exist and no conditions
were provided either null or false will be returned based on what was input.

Parameters

Array of conditions, conditions string, null or false. If an array of conditions,
or string conditions those conditions will be returned. With other values the model's existence will be checked.
If the model doesn't exist a null or false will be returned depending on the input value.

boolean
$useAliasoptionaltrue

Use model aliases rather than table names when generating conditions

Returns

mixedEither null, false, $conditions or an array of default conditions to use.

Returns

Queries 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 Configure::read('debug') is set, the log is shown all the time, else it is only shown on errors.

Options

log - Whether or not the query should be logged to the memory log.

Parameters

string
$sql

SQL statement

array
$optionsoptionalarray()

array
$paramsoptionalarray()

values to be bound to the query

Returns

mixedResource or object representing the result set, or false on failure

Returns

Returns an array of all result rows for a given SQL query.
Returns false if no rows matched.

Options

cache - Returns the cached version of the query, if exists and stores the result in cache.
This is a non-persistent cache, and only lasts for a single request. This option
defaults to true. If you are directly calling this method, you can disable caching
by setting $options to false

Parameters

Returns a quoted name of $data for use in an SQL statement.
Strips fields out of SQL functions before quoting.

Results of this method are stored in a memory cache. This improves performance, but
because the method uses a hashing algorithm it can have collisions.
Setting DboSource::$cacheMethods to false will disable the memory cache.

Parameters

mixed
$data

Either a string with a column to quote. An array of columns to quote or an
object from DboSource::expression() or DboSource::identifier()

Returns

See

Calls a controller's method from any location. Can be used to connect controllers together
or tie plugins into a main application. requestAction can be used to return rendered views
or fetch the return value from controller actions.

Under the hood this method uses Router::reverse() to convert the $url parameter into a string
URL. You should use URL formats that are compatible with Router::reverse()

Passing POST and GET data

POST and GET data can be simulated in requestAction. Use $extra['url'] for
GET data. The $extra['data'] parameter allows POST data simulation.

Parameters

string|array
$url

String or array-based URL. Unlike other URL arrays in CakePHP, this
URL will not automatically handle passed and named arguments in the $url parameter.

array
$extraoptionalarray()

if array includes the key "return" it sets the AutoRender to true. Can
also be used to submit GET/POST data, and named/passed arguments.

Returns

mixed

Boolean true or false on success/failure, or contents
of rendered action if 'return' is set in $extra.