property()
Description
Use this method to map an object property to either a table column with a different name than the property or to a specific SQL function. You only need to use this method when you want to override the default mapping that Wheels performs.
Function Syntax
property(name [, column, sql ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | |
The name that you want to use for the column or SQL function result in the CFML code. |
column |
string |
No | |
The name of the column in the database table to map the property to. |
sql |
string |
No | |
An SQL function to use to calculate the property value. |
Examples
<!--- Tell Wheels that when we are referring to `firstName` in the CFML code it should translate to the `STR_USERS_FNAME` column when interacting with the database instead of the default (which would be the `firstname` column) --->
<cfset property(name="firstName", column="STR_USERS_FNAME")>
