Skip to content

Miscellaneous

afterFind()

afterFind() — returns any

Registers method(s) that should be called after an existing object has been initialized (which is usually done with the findByKey or findOne method).

NameTypeRequiredDefaultDescription
methodsstringyesSee documentation for afterNew.
<!--- 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>