PageRenderTime 453ms CodeModel.GetById 121ms app.highlight 1ms RepoModel.GetById 190ms app.codeStats 0ms

/wheels/tests/_assets/models/User.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 32 lines | 27 code | 5 blank | 0 comment | 0 complexity | 6ab50865648168e5a81dbcbf2c5ba43f MD5 | raw file
 1<cfcomponent extends="Model">
 2
 3	<cffunction name="init">
 4		<cfset hasMany(name="galleries")>
 5		<cfset hasOne(name="combikey")>
 6		<!--- crazy join to test the joinKey argument --->
 7		<cfset hasOne(name="author", foreignKey="firstName", joinKey="firstName")>
 8		<cfset hasMany(name="authors", foreignKey="firstName", joinKey="firstName")>
 9		<cfset hasMany(name="combikeys")>
10		<cfset hasMany(name="outerjoinphotogalleries", modelName="gallery", jointype="outer")>
11		<cfset validatesPresenceOf("username,password,firstname,lastname")>
12		<cfset validatesUniquenessOf("username")>
13		<cfset validatesLengthOf(property="username", minimum="4", when="onCreate")>
14		<cfset validatesLengthOf(property="password", minimum="4", when="onUpdate")>
15		<cfset validate("validateCalled")>
16		<cfset validateOnCreate("validateOnCreateCalled")>
17		<cfset validateOnUpdate("validateOnUpdateCalled")>
18	</cffunction>
19
20	<cffunction name="validateCalled">
21		<cfset this._validateCalled = true>
22	</cffunction>
23
24	<cffunction name="validateOnCreateCalled">
25		<cfset this._validateOnCreateCalled = true>
26	</cffunction>
27
28	<cffunction name="validateOnUpdateCalled">
29		<cfset this._validateOnUpdateCalled = true>
30	</cffunction>
31
32</cfcomponent>