PageRenderTime 551ms CodeModel.GetById 221ms app.highlight 0ms RepoModel.GetById 181ms app.codeStats 0ms

/wheels/tests/_assets/models/Author.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 19 lines | 16 code | 3 blank | 0 comment | 0 complexity | 49f6776e5986d171478eb88ba187c289 MD5 | raw file
 1<cfcomponent extends="Model">
 2
 3	<cffunction name="init">
 4		<cfset hasMany("posts")>
 5		<cfset hasOne("profile")>
 6		<!--- crazy join to test the joinKey argument --->
 7		<cfset belongsTo(name="user", foreignKey="firstName", joinKey="firstName")>
 8		<cfset beforeSave("callbackThatReturnsTrue")>
 9		<cfset beforeDelete("callbackThatReturnsTrue")>
10		<cfset property(name="firstName", label="First name(s)", defaultValue="Dave")>
11		<cfset property(name="lastName", label="Last name", defaultValue="")>
12		<cfset nestedProperties(associations="profile", allowDelete=true)>
13	</cffunction>
14
15	<cffunction name="callbackThatReturnsTrue">
16		<cfreturn true>
17	</cffunction>
18
19</cfcomponent>