Miscellaneous
afterFind()
Signature
Section titled “Signature”afterFind() — returns any
Description
Section titled “Description”Registers method(s) that should be called after an existing object has been initialized (which is usually done with the findByKey or findOne method).
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
methods | string | yes | — | See documentation for afterNew. |
Examples
Section titled “Examples”<!--- Instruct CFWheels to call the `setTime` method after getting objects or records with one of the finder methods --->
<cffunction name="init">
<cfset afterFind("setTime")>
</cffunction>
<cffunction name="setTime">
<cfset arguments.fetchedAt = Now()>
<cfreturn arguments>
</cffunction>