params.keyvariable has been created from the URL (for example a URL such as
findOne()method like so:
SELECTclause of the SQL statement.
selectargument, Wheels will assume that you want all columns returned and create a
SELECTclause looking something like this:
artistmodel is mapped to the
artiststable and will prepend the table name to the column names accordingly.
includeargument below) and there are ambiguous column names, Wheels will sort this out for you by prepending the model name to the column name.
namein both the
SELECTclause will be created like this:
SELECTclause, you can do so by specifying the table names (i.e.
author.firstName) in the
selectargument or by using alias names (i.e.,
firstname AS firstName). If Wheels comes across the use of any of these techniques, it will assume you know what you're doing and pass on the select argument straight to the
SELECTclause with no changes.
WHEREclause of the SQL statement. Wheels will also convert all your input to
cfqueryparamtags for you automatically.
whereargument, but the following SQL will work:
=, !=, <>, <, <=, >, >=, LIKE, NOT LIKE, IN, NOT IN, IS NULL, IS NOT NULL, AND,and
OR. (Note that it's a requirement to write SQL keywords in upper case.) In addition to this, you can use parentheses to group conditional SQL statements together.
BETWEENoperator, you can get around this by using
ORDERclause of the SQL statement. If you don't specify an order at all, none will be used. (Makes sense, eh?) So in those cases, the database engine will decide in what order to return the records. Note that it's a requirement to write the SQL keywords
DESCin upper case.
pageargument) without specifying the order, Wheels will order the results by the primary key column. This is because pagination relies on having unique records to order by.
Articles, then you can return all authors and articles in the same call by doing this:
cachedwithinattribute of the
CreateObject()function. Be careful when setting
objects. You won't want to create a lot of objects in your array and slow down your application unless you absolutely need to.
findAll()call to use, you can specify a structure of arguments for each model/index you'd like to use. Only MySQL and SQLServer support index hints.