Miscellaneous
model()
Signature
Section titled “Signature”model() — returns any
Description
Section titled “Description”Returns a reference to the requested model so that class level methods can be called on it.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | — | Name of the model to get a reference to. |
Examples
Section titled “Examples”model(name) <!--- The `model("author")` part of the code below gets a reference to the model from the application scope, and then the `findByKey` class level method is called on it --->
<cfset authorObject = model("author").findByKey(1)>