PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms 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
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="Model">
  2. <cffunction name="init">
  3. <cfset hasMany("posts")>
  4. <cfset hasOne("profile")>
  5. <!--- crazy join to test the joinKey argument --->
  6. <cfset belongsTo(name="user", foreignKey="firstName", joinKey="firstName")>
  7. <cfset beforeSave("callbackThatReturnsTrue")>
  8. <cfset beforeDelete("callbackThatReturnsTrue")>
  9. <cfset property(name="firstName", label="First name(s)", defaultValue="Dave")>
  10. <cfset property(name="lastName", label="Last name", defaultValue="")>
  11. <cfset nestedProperties(associations="profile", allowDelete=true)>
  12. </cffunction>
  13. <cffunction name="callbackThatReturnsTrue">
  14. <cfreturn true>
  15. </cffunction>
  16. </cfcomponent>