Miscellaneous
setTableNamePrefix()
Signature
Section titled “Signature”setTableNamePrefix() — returns any
Description
Section titled “Description”Sets a prefix to prepend to the table name when this model runs SQL queries.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
prefix | string | yes | — | A prefix to prepend to the table name. |
Examples
Section titled “Examples”setTableNamePrefix(prefix) <!--- In `models/User.cfc`, add a prefix to the default table name of `tbl` --->
<cffunction name="init">
<cfset setTableNamePrefix("tbl")>
</cffunction>